Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TomasMikula opened this issue Apr 5, 2021 · 1 comment · Fixed by #12041
Closed

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

TomasMikula opened this issue Apr 5, 2021 · 1 comment · Fixed by #12041
Assignees
Milestone

Comments

@TomasMikula
Copy link
Contributor

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
@b-studios
Copy link
Contributor

b-studios commented Apr 8, 2021

This is a regression introduced by the soundness fix in #11059.

odersky added a commit to dotty-staging/dotty that referenced this issue Apr 9, 2021
odersky added a commit to dotty-staging/dotty that referenced this issue Apr 9, 2021
odersky added a commit to dotty-staging/dotty that referenced this issue Apr 12, 2021
Fixes scala#11993

# Conflicts:
#	compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala
#	tests/generic-java-signatures/derivedNames.scala
michelou pushed a commit to michelou/scala3 that referenced this issue Apr 14, 2021
michelou pushed a commit to michelou/scala3 that referenced this issue Apr 14, 2021
@Kordyjan Kordyjan added this to the 3.0.1 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants