aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-03-03 10:37:29 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-03-18 11:14:13 +0100
commit6220d5c0a31d513cfcb28dba1df14176d527201d (patch)
tree0ad91c8b3515102d87ba234905004c5ecfdc7dbd /src/dotty/tools/dotc/typer/Namer.scala
parent6dc3d62d68d7135c055da9589456d27eee89de80 (diff)
downloaddotty-6220d5c0a31d513cfcb28dba1df14176d527201d.tar.gz
dotty-6220d5c0a31d513cfcb28dba1df14176d527201d.tar.bz2
dotty-6220d5c0a31d513cfcb28dba1df14176d527201d.zip
Better tracking of unhygienic closure types
We have two unhygienic closures left - one in t1957.scala the other in Typer.scala. This commit leaves some printlns that can be uncommented to get more info on these. It would be better to fix them but I am running out of time to do so. Maybe someone else can pick up with the info this commit allows to recover.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index 8fe47582b..04f648c00 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -664,8 +664,11 @@ class Namer { typer: Typer =>
mdef match {
case mdef: DefDef if mdef.name == nme.ANON_FUN =>
val hygienicType = avoid(rhsType, paramss.flatten)
- hygienicType <:< tpt.tpe
- typr.println(i"lifting $rhsType over $paramss -> $hygienicType = ${tpt.tpe}")
+ if (!(hygienicType <:< tpt.tpe))
+ ctx.error(i"return type ${tpt.tpe} of lambda cannot be made hygienic;\n" +
+ i"it is not a supertype of the hygienic type $hygienicType", mdef.pos)
+ //println(i"lifting $rhsType over $paramss -> $hygienicType = ${tpt.tpe}")
+ //println(TypeComparer.explained { implicit ctx => hygienicType <:< tpt.tpe })
case _ =>
}
WildcardType