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 =>
1320
1320
def cookedRhsType = deskolemize(dealiasIfUnit(widenRhs(rhsType)))
1321
1321
def lhsType = fullyDefinedType(cookedRhsType, " right-hand side" , mdef.span)
1322
1322
// 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
1332
1325
else {
1333
1326
if (sym.is(Implicit ))
1334
1327
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