File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
src/compiler/scala/tools/nsc/transform Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -764,7 +764,7 @@ abstract class Constructors extends Statics with Transform with TypingTransforme
764764 primaryConstrBody.expr)
765765 })
766766
767- if (omittableAccessor.exists(_.isOuterField) && ! constructorStats.exists(_.exists { case i : Ident if i.symbol.isOuterParam => true ; case _ => false }))
767+ if ((exitingPickler(clazz.isAnonymousClass) || clazz.originalOwner.isTerm) && omittableAccessor.exists(_.isOuterField) && ! constructorStats.exists(_.exists { case i : Ident if i.symbol.isOuterParam => true ; case _ => false }))
768768 primaryConstructor.symbol.updateAttachment(OuterArgCanBeElided )
769769
770770 val constructors = primaryConstructor :: auxConstructors
Original file line number Diff line number Diff line change 1+ class Outer {
2+ final class Inner {
3+ def foo : Unit = ()
4+ }
5+ }
6+ object Test {
7+ def main (args : Array [String ]): Unit = {
8+ val o = new Outer
9+ new o.Inner ().foo
10+ }
11+ }
Original file line number Diff line number Diff line change 1+ class Outer {
2+ class Inner {
3+ def foo : Unit = assert(Outer .this ne null )
4+ }
5+ }
6+
You can’t perform that action at this time.
0 commit comments