Skip to content

Commit d041410

Browse files
committed
WIP
1 parent f1ae9b3 commit d041410

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,11 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
456456
// skip this member
457457
return NoSymbol
458458

459+
// Adapt the flags of getters so they become like vals/vars instead
460+
if flags.isAllOf(Method | Accessor) && !name.toString().endsWith("_=") then
461+
flags &~= Method | Accessor
462+
if !flags.is(StableRealizable) then flags |= Mutable
463+
459464
name = name.adjustIfModuleClass(flags)
460465
if (flags.is(Method))
461466
name =
@@ -620,7 +625,12 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
620625
setClassInfo(denot, tp, fromScala2 = true, selfInfo)
621626
NamerOps.addConstructorProxies(denot.classSymbol)
622627
case denot =>
623-
val tp1 = translateTempPoly(tp)
628+
val tp0 = translateTempPoly(tp)
629+
val tp1 =
630+
if !denot.is(Param) && !denot.is(Method) && tp0.isInstanceOf[ExprType] then
631+
tp0.asInstanceOf[ExprType].resultType
632+
else tp0
633+
624634
denot.info =
625635
if (tag == ALIASsym) TypeAlias(tp1)
626636
else if (denot.isType) checkNonCyclic(denot.symbol, tp1, reportErrors = false)

0 commit comments

Comments
 (0)