File tree 2 files changed +23
-2
lines changed
src/dotty/tools/dotc/typer
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -563,7 +563,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
563
563
val pos = params indexWhere (_.name == param.name)
564
564
if (pos < mtpe.paramTypes.length) {
565
565
val ptype = mtpe.paramTypes(pos)
566
- if (isFullyDefined(ptype, ForceDegree .none )) return ptype
566
+ if (isFullyDefined(ptype, ForceDegree .noBottom )) return ptype
567
567
}
568
568
case _ =>
569
569
}
@@ -1265,7 +1265,16 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1265
1265
1266
1266
def adapt (tree : Tree , pt : Type , original : untpd.Tree = untpd.EmptyTree )(implicit ctx : Context ) = /* >|>*/ track(" adapt" ) /* <|<*/ {
1267
1267
/* >|>*/ ctx.traceIndented(i " adapting $tree of type ${tree.tpe} to $pt" , typr, show = true ) /* <|<*/ {
1268
- interpolateUndetVars(tree, if (tree.isDef) tree.symbol else NoSymbol )
1268
+ val isMethodCall =
1269
+ tree.tpe.widen match {
1270
+ case (_ : MethodType ) | (_ : PolyType ) if ! tree.isDef =>
1271
+ true
1272
+ case _ =>
1273
+ false
1274
+ }
1275
+ if (! isMethodCall) // Delay tvar interpolation in method calls until they're fully applied
1276
+ interpolateUndetVars(tree, if (tree.isDef) tree.symbol else NoSymbol )
1277
+
1269
1278
tree.overwriteType(tree.tpe.simplified)
1270
1279
adaptInterpolated(tree, pt, original)
1271
1280
}
Original file line number Diff line number Diff line change
1
+ object Test {
2
+ def foo1 [T ](x : T )(implicit ev : T ): Nothing = ???
3
+ def foo2 [T ](x : T )(implicit ev : T ): T = ???
4
+
5
+ def test : Unit = {
6
+ implicit val ii : Int = 42
7
+
8
+ foo1(10 )
9
+ foo2(10 )
10
+ }
11
+ }
12
+
You can’t perform that action at this time.
0 commit comments