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
companions and method-owned case classes #3772
Comments
Imported From: https://issues.scala-lang.org/browse/SI-3772?orig=1 |
@lrytz said: http://github.com/soundrabbit/scala/commit/9cfe04f6f765fbfd7fad4547e910dc05e4e47cf2 |
@lrytz said: scala> def g { case class C(); object C; }
<console>:5: error: C is already defined as (compiler-generated) case class companion object C
def g { case class C(); object C; }
^ review by odersky |
@JamesIry said: |
@xeno-by said: |
@adriaanm said: |
@xeno-by said: |
Eyal Roth (errr) said: |
@retronym said: |
@retronym said: |
What happens:
ensureCompanionObject
looks up a term symbolm
in the current scope named after the class. Then there are two cases:m
is actually found. But then,inCurrentScope(m)
is called which returns false. I don't understand what this method actually checks. But this should be easy to fix.m == NoSymbol
) because the correspondingenterModuleSymbol
has not run yet, it will only run later in the namer phase.Another way to reproduce the same problem:
The text was updated successfully, but these errors were encountered: