File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1137,12 +1137,17 @@ class Namer { typer: Typer =>
11371137 }
11381138
11391139 def cookedRhsType = deskolemize(dealiasIfUnit(widenRhs(rhsType)))
1140- lazy val lhsType = fullyDefinedType(cookedRhsType, " right-hand side" , mdef.pos)
1140+ def lhsType = fullyDefinedType(cookedRhsType, " right-hand side" , mdef.pos)
11411141 // if (sym.name.toString == "y") println(i"rhs = $rhsType, cooked = $cookedRhsType")
1142- if (inherited.exists)
1143- if (sym.is(Final , butNot = Method ) && lhsType.isInstanceOf [ConstantType ])
1144- lhsType // keep constant types that fill in for a non-constant (to be revised when inline has landed).
1142+ if (inherited.exists) {
1143+ if (sym.is(Final , butNot = Method )) {
1144+ val tp = lhsType
1145+ if (tp.isInstanceOf [ConstantType ])
1146+ tp // keep constant types that fill in for a non-constant (to be revised when inline has landed).
1147+ else inherited
1148+ }
11451149 else inherited
1150+ }
11461151 else {
11471152 if (sym is Implicit )
11481153 mdef match {
You can’t perform that action at this time.
0 commit comments