Skip to content

Commit 5d4e4e2

Browse files
committed
Added make not private logic for @inline accesses back to ExplicitOuter.
As discussed in https://mail.google.com/mail/u/0/?hl=en&tab=Tm#search/inlining+changes+needed/1390c955960d7cb5, we need to move access widenings back to ExplicitOuter, so that outer fields are correctly widened. The previous logiv in SuperAccessors can go once the inliner is adapted to the new scheme. I leave SuperAccessors for the moment as is, in order not to slide back even further with inlining.
1 parent 4459e5a commit 5d4e4e2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,10 @@ abstract class ExplicitOuter extends InfoTransform
497497
else atPos(tree.pos)(outerPath(outerValue, currentClass.outerClass, sym)) // (5)
498498

499499
case Select(qual, name) =>
500-
if (currentClass != sym.owner)
500+
// make not private symbol acessed from inner classes, as well as
501+
// symbols accessed from @inline methods
502+
if (currentClass != sym.owner ||
503+
(sym.owner.enclMethod hasAnnotation ScalaInlineClass))
501504
sym.makeNotPrivate(sym.owner)
502505

503506
val qsym = qual.tpe.widen.typeSymbol

0 commit comments

Comments
 (0)