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 =>
1137
1137
}
1138
1138
1139
1139
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)
1141
1141
// 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
+ }
1145
1149
else inherited
1150
+ }
1146
1151
else {
1147
1152
if (sym is Implicit )
1148
1153
mdef match {
You can’t perform that action at this time.
0 commit comments