diff options
author | Martin Odersky <odersky@gmail.com> | 2013-12-16 11:32:03 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-12-16 11:32:03 +0100 |
commit | f3d428e6957501578c9516de2d179adf713ca95f (patch) | |
tree | 2807ac65c3ecf3c22e39df810e12f7ce0d691465 /src | |
parent | 4079d6d5048dbebf5aaac06be42e9b9484b3934f (diff) | |
download | dotty-f3d428e6957501578c9516de2d179adf713ca95f.tar.gz dotty-f3d428e6957501578c9516de2d179adf713ca95f.tar.bz2 dotty-f3d428e6957501578c9516de2d179adf713ca95f.zip |
Fix to desugaring refinement types.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/ast/Desugar.scala | 3 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/ast/Desugar.scala b/src/dotty/tools/dotc/ast/Desugar.scala index 7692d5a95..267e1a607 100644 --- a/src/dotty/tools/dotc/ast/Desugar.scala +++ b/src/dotty/tools/dotc/ast/Desugar.scala @@ -696,7 +696,8 @@ object desugar { * The result is used for validity checking, is thrown away afterwards. */ def refinedTypeToClass(tree: RefinedTypeTree)(implicit ctx: Context): TypeDef = { - val impl = Template(emptyConstructor, tree.tpt :: Nil, EmptyValDef, tree.refinements) + val parent = Select(New(tree.tpt), nme.CONSTRUCTOR) + val impl = Template(emptyConstructor, parent :: Nil, EmptyValDef, tree.refinements) TypeDef(Modifiers(), tpnme.REFINE_CLASS, impl) } diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 2645cf450..4e9d5953a 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -708,7 +708,7 @@ class Typer extends Namer with Applications with Implicits { } val res = cpy.RefinedTypeTree(tree, tpt1, refinements1) withType (tpt1.tpe /: refinements1)(addRefinement) - println(s"typed refinement: ${res.tpe}") + // println(s"typed refinement: ${res.tpe.show}") res } |