From 8216688420003002449313c8a4f419b09282bf84 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 22 Dec 2013 16:11:43 +0100 Subject: Desugaring changes 1) Desugar type bounds containing empty trees 2) Include a productN parent for a case class, only if the case class has 2 or more parameters in its parameter section. Also, handle type bounds appearing in AppliedTypeTrees (these represent wildcard types). --- src/dotty/tools/dotc/typer/Typer.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Typer.scala') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 69705cfce..54a299291 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -708,8 +708,9 @@ class Typer extends Namer with Applications with Implicits { } def typedTypeBoundsTree(tree: untpd.TypeBoundsTree)(implicit ctx: Context): TypeBoundsTree = track("typedTypeBoundsTree") { - val lo1 = typed(tree.lo) - val hi1 = typed(tree.hi) + val TypeBoundsTree(lo, hi) = desugar.typeBoundsTree(tree) + val lo1 = typed(lo) + val hi1 = typed(hi) if (!(lo1.tpe <:< hi1.tpe)) ctx.error(i"lower bound ${lo1.tpe} does not conform to upper bound ${hi1.tpe}", tree.pos) cpy.TypeBoundsTree(tree, lo1, hi1) withType TypeBounds(lo1.tpe, hi1.tpe) -- cgit v1.2.3