File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
src/compiler/scala/tools/nsc/typechecker Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1285,7 +1285,11 @@ trait Namers extends MethodSynthesis {
1285
1285
1286
1286
val resTpGiven =
1287
1287
if (tpt.isEmpty) WildcardType
1288
- else typer.typedType(tpt).tpe
1288
+ else {
1289
+ val tp = typer.typedType(tpt).tpe
1290
+ ddef.tpt setType tp
1291
+ tp
1292
+ }
1289
1293
1290
1294
1291
1295
// ignore missing types unless we can look to overridden method to recover the missing information
@@ -1412,7 +1416,9 @@ trait Namers extends MethodSynthesis {
1412
1416
// trait T { def f: A }; class C extends T { implicit def b2a(t: B): A = ???; def f = new B }
1413
1417
val resTpComputedUnlessGiven =
1414
1418
if (tpt.isEmpty) assignTypeToTree(ddef, typer, resTpFromOverride)
1415
- else resTpGiven
1419
+ else {
1420
+ resTpGiven
1421
+ }
1416
1422
1417
1423
// #2382: return type of default getters are always @uncheckedVariance
1418
1424
if (meth.hasDefault) resTpComputedUnlessGiven.withAnnotation(AnnotationInfo (uncheckedVarianceClass.tpe, List (), List ()))
@@ -1636,7 +1642,11 @@ trait Namers extends MethodSynthesis {
1636
1642
1637
1643
tptFromRhsUnderPt
1638
1644
}
1639
- } else typer.typedType(tpt).tpe
1645
+ } else {
1646
+ val tp = typer.typedType(tpt).tpe
1647
+ vdef.tpt setType tp
1648
+ tp
1649
+ }
1640
1650
1641
1651
// println(s"val: $result / ${vdef.tpt.tpe} / ")
1642
1652
You can’t perform that action at this time.
0 commit comments