Skip to content

Commit 9dec67f

Browse files
committed
Fix exception for NoSymbol
1 parent d6a4221 commit 9dec67f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

compiler/src/dotty/tools/dotc/transform/init/Semantic.scala

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,11 +1513,14 @@ object Semantic:
15131513
thisV.accessLocal(tmref, klass)
15141514

15151515
case tmref: TermRef =>
1516-
val cls = tmref.widenSingleton.classSymbol.asClass
1517-
if cls.isStaticOwner && !cls.isContainedIn(promoted.entryClass) then
1518-
Hot
1519-
else if cls.isStaticOwner && klass.isContainedIn(cls) then
1520-
resolveThis(cls, thisV, klass)
1516+
val cls = tmref.widenSingleton.classSymbol
1517+
if cls.exists && cls.isStaticOwner then
1518+
if klass.isContainedIn(cls) then
1519+
resolveThis(cls.asClass, thisV, klass)
1520+
else if cls.isContainedIn(promoted.entryClass) then
1521+
cases(tmref.prefix, thisV, klass).select(tmref.symbol, receiver = tmref.prefix)
1522+
else
1523+
Hot
15211524
else
15221525
cases(tmref.prefix, thisV, klass).select(tmref.symbol, receiver = tmref.prefix)
15231526

0 commit comments

Comments
 (0)