aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-08-08 21:37:49 +0200
committerMartin Odersky <odersky@gmail.com>2014-08-08 21:38:17 +0200
commit19b6a04486a4f9a2a7803d40d7ef6199cdeaf31c (patch)
treea55e634795d79d084310d5aa533751d91dfc78fb /src/dotty/tools/dotc/typer/Typer.scala
parent058729ceac3354a2cc34490b528e76afb09ee0ce (diff)
downloaddotty-19b6a04486a4f9a2a7803d40d7ef6199cdeaf31c.tar.gz
dotty-19b6a04486a4f9a2a7803d40d7ef6199cdeaf31c.tar.bz2
dotty-19b6a04486a4f9a2a7803d40d7ef6199cdeaf31c.zip
Re-enabled checkbounds tests
Now that F-bunded types are treated more robustly, we can check bounds for non-emptyness during Typer. This unvealed one wrong test (wonder how that passed scalac?), which got moved to neg.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index d5153bf13..2024a993e 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -735,7 +735,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
def typedAppliedTypeTree(tree: untpd.AppliedTypeTree)(implicit ctx: Context): AppliedTypeTree = track("typedAppliedTypeTree") {
val tpt1 = typed(tree.tpt)
val args1 = tree.args mapconserve (typed(_))
- // todo in later phase: check arguments conform to parameter bounds
+ // check that arguments conform to bounds is done in phase FirstTransform
assignType(cpy.AppliedTypeTree(tree, tpt1, args1), tpt1, args1)
}
@@ -748,9 +748,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
val TypeBoundsTree(lo, hi) = desugar.typeBoundsTree(tree)
val lo1 = typed(lo)
val hi1 = typed(hi)
- // need to do in later phase, as this might cause a cyclic reference error. See pos/t0039.scala
- // if (!(lo1.tpe <:< hi1.tpe))
- // ctx.error(d"lower bound ${lo1.tpe} does not conform to upper bound ${hi1.tpe}", tree.pos)
+ if (!(lo1.tpe <:< hi1.tpe))
+ ctx.error(d"lower bound ${lo1.tpe} does not conform to upper bound ${hi1.tpe}", tree.pos)
assignType(cpy.TypeBoundsTree(tree, lo1, hi1), lo1, hi1)
}