Skip to content

Failure to infer dependently typed constructor parameter (regression) #11993

Closed
@TomasMikula

Description

@TomasMikula

Compiler version

3.0.0-RC2

Minimized code

class Foo(
  val x: String,
  val y: Option[x.type]
)

class Bar extends Foo("bar", Some("bar"))

Output

In 3.0.0-RC1, this compiles, as expected.

In 3.0.0-RC2:

6 |class Bar extends Foo("bar", Some("bar"))
  |      ^
  |illegal parameter: The types of value y do not match.
  |
  |  value y in class Foo has type: Option[(Foo#x : String)]
  |  but class Bar expects value y to have type: Option[(Bar.this.x : String)]
1 error found

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions