File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1242,7 +1242,11 @@ class Typer extends Namer with Applications with Implicits {
1242
1242
if defn.isFunctionType(wtp) && ! defn.isFunctionType(pt) =>
1243
1243
pt match {
1244
1244
case SAMType (meth)
1245
- if wtp <:< meth.info.toFunctionType && isFullyDefined(pt, ForceDegree .noBottom) =>
1245
+ if wtp <:< meth.info.toFunctionType =>
1246
+ // was ... && isFullyDefined(pt, ForceDegree.noBottom)
1247
+ // but this prevents case blocks from implementing polymorphic partial functions,
1248
+ // since we do not know the result parameter a priori. Have to wait until the
1249
+ // body is typechecked.
1246
1250
return cpy.Closure (tree, Nil , id, TypeTree (pt)).withType(pt)
1247
1251
case _ =>
1248
1252
}
You can’t perform that action at this time.
0 commit comments