diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-01-22 10:34:17 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-11-26 22:34:28 +1000 |
commit | eeeb92c3d59de611dec1782a969b86171454de40 (patch) | |
tree | b36417943cc498e682e9eb0e402bcae06985f4fa /src/reflect | |
parent | 2ef93ad2fe29766fbe09a3e921ad361b25abdeaf (diff) | |
download | scala-eeeb92c3d59de611dec1782a969b86171454de40.tar.gz scala-eeeb92c3d59de611dec1782a969b86171454de40.tar.bz2 scala-eeeb92c3d59de611dec1782a969b86171454de40.zip |
SI-9110 Pattern `O.C` must check `$outer eq O` for a top level O
The outer check was not being generated when the prefix was a
top level module. The enclosed test shows that we in fact must
synthesize the outer check in that case.
Perhaps the bug was introduced by neglecting to consider that
a module can inherit member classes.
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/internal/Types.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index b282026c36..5b23bbf144 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -3940,7 +3940,8 @@ trait Types def maybeCreateDummyClone(pre: Type, sym: Symbol): Type = pre match { case SingleType(pre1, sym1) => if (sym1.isModule && sym1.isStatic) { - NoType + if (sym.owner == sym1 || sym.isJavaDefined || sym.owner.sourceModule.isStaticModule) NoType + else pre } else if (sym1.isModule && sym.owner == sym1.moduleClass) { val pre2 = maybeCreateDummyClone(pre1, sym1) if (pre2 eq NoType) pre2 |