aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc')
-rw-r--r--src/dotty/tools/dotc/ast/Desugar.scala4
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/ast/Desugar.scala b/src/dotty/tools/dotc/ast/Desugar.scala
index 54ea96eed..7b483adb9 100644
--- a/src/dotty/tools/dotc/ast/Desugar.scala
+++ b/src/dotty/tools/dotc/ast/Desugar.scala
@@ -420,9 +420,9 @@ object desugar {
* def $anonfun(params) = body
* Closure($anonfun)
*/
- def makeClosure(params: List[ValDef], body: Tree) =
+ def makeClosure(params: List[ValDef], body: Tree, tpt: Tree = TypeTree()) =
Block(
- DefDef(Modifiers(Synthetic), nme.ANON_FUN, Nil, params :: Nil, TypeTree(), body),
+ DefDef(Modifiers(Synthetic), nme.ANON_FUN, Nil, params :: Nil, tpt, body),
Closure(Nil, Ident(nme.ANON_FUN), EmptyTree))
/** Expand partial function
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 92ef0a266..c6c39f3e2 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -586,10 +586,10 @@ class Typer extends Namer with Applications with Implicits {
cpy.ValDef(param, param.mods, param.name, paramTpt, param.rhs)
}
- /*val resultTpt =
+ val resultTpt =
if (isFullyDefined(protoResult, ForceDegree.none)) untpd.TypeTree(protoResult)
- else untpd.TypeTree()*/
- typed(desugar.makeClosure(inferredParams, fnBody/*, resultTpt*/), pt)
+ else untpd.TypeTree()
+ typed(desugar.makeClosure(inferredParams, fnBody, resultTpt), pt)
}
}