File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -697,7 +697,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
697
697
case _ : WildcardType => untpd.TypeTree ()
698
698
case _ => untpd.TypeTree (tp)
699
699
}
700
- pt match {
700
+ pt.stripTypeVar match {
701
701
case _ if defn.isNonDepFunctionType(pt) =>
702
702
// if expected parameter type(s) are wildcards, approximate from below.
703
703
// if expected result type is a wildcard, approximate from above.
@@ -711,6 +711,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
711
711
untpd.DependentTypeTree (syms => restpe.substParams(mt, syms.map(_.termRef)))
712
712
else
713
713
typeTree(restpe))
714
+ case tp : TypeParamRef =>
715
+ decomposeProtoFunction(ctx.typerState.constraint.entry(tp).bounds.hi, defaultArity)
714
716
case _ =>
715
717
(List .tabulate(defaultArity)(alwaysWildcardType), untpd.TypeTree ())
716
718
}
Original file line number Diff line number Diff line change @@ -33,4 +33,11 @@ object Functions {
33
33
val z : Spore [String , String ] = x => x + x
34
34
val z2 : Spore2 [String , String ] = x => x + x
35
35
}
36
+
37
+ object retType {
38
+ val a : List [() => 4 ] = List (() => 4 )
39
+
40
+ class Inv [T ]
41
+ val b : List [() => Inv [Int ]] = List (() => new Inv )
42
+ }
36
43
}
You can’t perform that action at this time.
0 commit comments