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 {
390390 def genLoadQualUnlessElidable (): Unit = { if (! qualSafeToElide) { genLoadQualifier(tree) } }
391391
392392 // 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
394394 if (sym.is(Module )) {
395395 genLoadQualUnlessElidable()
396396 genLoadModule(tree)
Original file line number Diff line number Diff line change @@ -1383,7 +1383,11 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
13831383 /** Recover identifier prefix (e.g. this) if it exists */
13841384 def desugarIdentPrefix (tree : Ident )(using Context ): Tree = tree.tpe match {
13851385 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)
13871391 case TermRef (prefix : ThisType , _) =>
13881392 This (prefix.cls)
13891393 case _ =>
You can’t perform that action at this time.
0 commit comments