File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -390,7 +390,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
390
390
def genLoadQualUnlessElidable (): Unit = { if (! qualSafeToElide) { genLoadQualifier(tree) } }
391
391
392
392
// receiverClass is used in the bytecode to access the field. using sym.owner may lead to IllegalAccessError
393
- def receiverClass = qualifier.tpe.widenTermRefExpr.finalResultType. typeSymbol
393
+ def receiverClass = qualifier.tpe.typeSymbol
394
394
if (sym.is(Module )) {
395
395
genLoadQualUnlessElidable()
396
396
genLoadModule(tree)
Original file line number Diff line number Diff line change @@ -1383,7 +1383,11 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
1383
1383
/** Recover identifier prefix (e.g. this) if it exists */
1384
1384
def desugarIdentPrefix (tree : Ident )(using Context ): Tree = tree.tpe match {
1385
1385
case TermRef (prefix : TermRef , _) =>
1386
- ref(prefix)
1386
+ prefix.info match
1387
+ case mt : MethodType if mt.paramInfos.isEmpty && mt.resultType.typeSymbol.is(Module ) =>
1388
+ ref(mt.resultType.typeSymbol.sourceModule)
1389
+ case _ =>
1390
+ ref(prefix)
1387
1391
case TermRef (prefix : ThisType , _) =>
1388
1392
This (prefix.cls)
1389
1393
case _ =>
You can’t perform that action at this time.
0 commit comments