Skip to content

Commit e42b83e

Browse files
committed
Unrelated hardening of ExpandPrivate
I noticed a REPL crash because we triggered the error condition but there was no source associated with context.owner.
1 parent 6a12079 commit e42b83e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/src/dotty/tools/dotc/transform/ExpandPrivate.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class ExpandPrivate extends MiniPhase with IdentityDenotTransformer { thisPhase
9090
}
9191

9292
assert(d.symbol.sourceFile != null &&
93+
ctx.owner.sourceFile != null &&
9394
isSimilar(d.symbol.sourceFile.path, ctx.owner.sourceFile.path),
9495
s"private ${d.symbol.showLocated} in ${d.symbol.sourceFile} accessed from ${ctx.owner.showLocated} in ${ctx.owner.sourceFile}")
9596
d.ensureNotPrivate.installAfter(thisPhase)

0 commit comments

Comments
 (0)