diff options
author | Martin Odersky <odersky@gmail.com> | 2013-12-22 16:11:43 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-12-22 16:12:47 +0100 |
commit | 8216688420003002449313c8a4f419b09282bf84 (patch) | |
tree | ee3ba0a2e0215bf20c4369a27e9133dc65f7fa3e /src/dotty/tools/dotc/typer/Typer.scala | |
parent | 115e13b323e9ca845302a2c0ee0367e03cb8379b (diff) | |
download | dotty-8216688420003002449313c8a4f419b09282bf84.tar.gz dotty-8216688420003002449313c8a4f419b09282bf84.tar.bz2 dotty-8216688420003002449313c8a4f419b09282bf84.zip |
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).
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 5 |
1 files changed, 3 insertions, 2 deletions
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) |