From 5150cad821a9e7db821732eeb19019b96e1975a0 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Sun, 28 Dec 2014 17:42:04 +0100 Subject: Prevent block types with references to local symbols --- src/dotty/tools/dotc/typer/Typer.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 59aba4723..1e07cbf79 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -472,7 +472,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit val Block(stats, expr) = block val leaks = escapingRefs(block) if (leaks.isEmpty) block - else if (isFullyDefined(pt, ForceDegree.all)) { + else if (isFullyDefined(pt, ForceDegree.none)) { val expr1 = Typed(expr, TypeTree(pt)) cpy.Block(block)(stats, expr1) withType expr1.tpe // no assignType here because avoid is redundant } else if (!forcedDefined) { -- cgit v1.2.3