diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-19 12:09:43 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-19 12:09:43 +0100 |
commit | 4d3d2d3177157c5b02f5ebc536de1b80aa37ddbb (patch) | |
tree | c3f9fa45dcf04ee88fbacde217c50b1347b6f1a2 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | d4204733c669ce4b198d9078f84d6617633c6d4f (diff) | |
download | dotty-4d3d2d3177157c5b02f5ebc536de1b80aa37ddbb.tar.gz dotty-4d3d2d3177157c5b02f5ebc536de1b80aa37ddbb.tar.bz2 dotty-4d3d2d3177157c5b02f5ebc536de1b80aa37ddbb.zip |
Dropping isFullyRefined requirement when adapting to SAM type.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 31964ce98..3f3899752 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -1242,7 +1242,11 @@ class Typer extends Namer with Applications with Implicits { if defn.isFunctionType(wtp) && !defn.isFunctionType(pt) => pt match { case SAMType(meth) - if wtp <:< meth.info.toFunctionType && isFullyDefined(pt, ForceDegree.noBottom) => + if wtp <:< meth.info.toFunctionType => + // was ... && isFullyDefined(pt, ForceDegree.noBottom) + // but this prevents case blocks from implementing polymorphic partial functions, + // since we do not know the result parameter a priori. Have to wait until the + // body is typechecked. return cpy.Closure(tree, Nil, id, TypeTree(pt)).withType(pt) case _ => } |