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
697697 case _ : WildcardType => untpd.TypeTree ()
698698 case _ => untpd.TypeTree (tp)
699699 }
700- pt match {
700+ pt.stripTypeVar match {
701701 case _ if defn.isNonDepFunctionType(pt) =>
702702 // if expected parameter type(s) are wildcards, approximate from below.
703703 // 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
711711 untpd.DependentTypeTree (syms => restpe.substParams(mt, syms.map(_.termRef)))
712712 else
713713 typeTree(restpe))
714+ case tp : TypeParamRef =>
715+ decomposeProtoFunction(ctx.typerState.constraint.entry(tp).bounds.hi, defaultArity)
714716 case _ =>
715717 (List .tabulate(defaultArity)(alwaysWildcardType), untpd.TypeTree ())
716718 }
Original file line number Diff line number Diff line change @@ -33,4 +33,11 @@ object Functions {
3333 val z : Spore [String , String ] = x => x + x
3434 val z2 : Spore2 [String , String ] = x => x + x
3535 }
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+ }
3643}
You can’t perform that action at this time.
0 commit comments