Skip to content

Disallow unbound wildcard types like "val x: (_ <: Any) = 1" #1403

Closed
@smarter

Description

@smarter

If you write:

val x: (_ <: Any) = 1

In scalac you get:

error: unbound wildcard type

But in dotty we get (after the compiler stops desperately searching for a matching implicit view for several seconds):

error: type mismatch:
 found   : Int(1)
 required:

Labelling this issue as Parser because that's where the error is emitted in scalac but I don't know if we wish to reimplement that logic in there or do something later.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions