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

nutty disambiguation of type aliases in error messages #8892

Closed
scabug opened this issue Oct 7, 2014 · 2 comments
Closed

nutty disambiguation of type aliases in error messages #8892

scabug opened this issue Oct 7, 2014 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Oct 7, 2014

trait A { type B = String }
class C[B](x: B) extends A { def f: B = x }
qscalac sandbox/gist.scala
sandbox/gist.scala:2: error: type mismatch;
 found   : B
 required: C.this.java.lang.B
    (which expands to)  String
class C[B](x: B) extends A { def f: B = x }
                                        ^
one error found

The culprit:

    // functions to manipulate the name
    def preQualify()   = modifyName(trueOwner.fullName + "." + _)
    def postQualify()  = modifyName(_ + "(in " + trueOwner + ")")
    def typeQualify()  = if (sym.isTypeParameterOrSkolem) postQualify()
    def nameQualify()  = if (trueOwner.isPackageClass) preQualify() else postQualify()

    def trueOwner  = tp.typeSymbol.effectiveOwner
    def aliasOwner = tp.typeSymbolDirect.effectiveOwner

scala/scala@beadafa2

@scabug
Copy link
Author

scabug commented Oct 7, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8892?orig=1
Reporter: @retronym
Affected Versions: 2.10.0-M5, 2.10.4, 2.11.2

@scabug
Copy link
Author

scabug commented Jun 20, 2015

@retronym said:
scala/scala#4569

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants