diff --git a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala index 8b939f5cc47e..39fe8f025af8 100644 --- a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala @@ -456,6 +456,11 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas // skip this member return NoSymbol + // Adapt the flags of getters so they become like vals/vars instead + if flags.isAllOf(Method | Accessor) && !name.toString().endsWith("_=") then + flags &~= Method | Accessor + if !flags.is(StableRealizable) then flags |= Mutable + name = name.adjustIfModuleClass(flags) if (flags.is(Method)) name = @@ -620,7 +625,12 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas setClassInfo(denot, tp, fromScala2 = true, selfInfo) NamerOps.addConstructorProxies(denot.classSymbol) case denot => - val tp1 = translateTempPoly(tp) + val tp0 = translateTempPoly(tp) + val tp1 = + if !denot.is(Param) && !denot.is(Method) && tp0.isInstanceOf[ExprType] then + tp0.asInstanceOf[ExprType].resultType + else tp0 + denot.info = if (tag == ALIASsym) TypeAlias(tp1) else if (denot.isType) checkNonCyclic(denot.symbol, tp1, reportErrors = false)