Skip to content
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

Type member shadows class type parameter #8421

Open
scabug opened this issue Mar 17, 2014 · 3 comments
Open

Type member shadows class type parameter #8421

scabug opened this issue Mar 17, 2014 · 3 comments
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) typer
Milestone

Comments

@scabug
Copy link

scabug commented Mar 17, 2014

trait T {
  type X
}

class C[X <: String] extends T {
  def foo(x: X): String = x
}
sandbox/test.scala:6: error: type mismatch;
 found   : C.this.X
 required: String
  def foo(x: X): String = x
                          ^
@scabug
Copy link
Author

scabug commented Mar 17, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8421?orig=1
Reporter: @retronym
Affected Versions: 2.9.3, 2.10.3, 2.11.0-RC1

@scabug
Copy link
Author

scabug commented Mar 17, 2014

@retronym said (edited on Mar 17, 2014 1:13:09 PM UTC):
WIP: https://github.com/retronym/scala/tree/ticket/8421

I'm a bit stuck with this one.

@scabug
Copy link
Author

scabug commented Mar 21, 2014

@retronym said:
Martin suggests to take a leaf out of dotty's book and add a synthetic private type accessor in the body of the class. This is analogous to the treatment of value parameters.

@scabug scabug added this to the Backlog milestone Apr 7, 2017
@SethTisue SethTisue added the fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) label Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) typer
Projects
None yet
Development

No branches or pull requests

3 participants