File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -1320,15 +1320,8 @@ class Namer { typer: Typer =>
13201320 def cookedRhsType = deskolemize(dealiasIfUnit(widenRhs(rhsType)))
13211321 def lhsType = fullyDefinedType(cookedRhsType, " right-hand side" , mdef.span)
13221322 // if (sym.name.toString == "y") println(i"rhs = $rhsType, cooked = $cookedRhsType")
1323- if (inherited.exists) {
1324- if (sym.is(Final , butNot = Method )) {
1325- val tp = lhsType
1326- if (tp.isInstanceOf [ConstantType ])
1327- tp // keep constant types that fill in for a non-constant (to be revised when inline has landed).
1328- else inherited
1329- }
1330- else inherited
1331- }
1323+ if (inherited.exists)
1324+ if (isInlineVal) lhsType else inherited
13321325 else {
13331326 if (sym.is(Implicit ))
13341327 mdef match {
Original file line number Diff line number Diff line change 1+ trait TC [T ] { def x : Int ; def y : Int = 0 }
2+
3+ given [T ] as TC [T ] {
4+ inline val x = 1
5+ }
6+
7+ given as TC [Int ] {
8+ inline val x = 2
9+ inline override val y = 3
10+ }
11+
12+ object Test extends App {
13+ val z : 2 = the[TC [Int ]].x
14+ val _: 3 = the[TC [Int ]].y
15+ }
You can’t perform that action at this time.
0 commit comments