aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-11 15:11:45 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-11 15:11:45 +0100
commitd68e4f85e7dbddb6a42a4be202e765d445268be6 (patch)
tree049efedaf32657b3d3837e466a915d7fc5c5b26a /src/dotty/tools/dotc/ast
parent0bf0d57f988b1fe3f29991f0cde6aaa1b996b0a2 (diff)
downloaddotty-d68e4f85e7dbddb6a42a4be202e765d445268be6.tar.gz
dotty-d68e4f85e7dbddb6a42a4be202e765d445268be6.tar.bz2
dotty-d68e4f85e7dbddb6a42a4be202e765d445268be6.zip
Handling refined types.
A refined type P { refinement } is expanded to a class class <refined> extends P { refinement } for type-checking. The problem is that the parent P does not always have a constructor. So we need to leave the parent as a type and add a special case to classDefSig that handles it.
Diffstat (limited to 'src/dotty/tools/dotc/ast')
-rw-r--r--src/dotty/tools/dotc/ast/Desugar.scala3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/ast/Desugar.scala b/src/dotty/tools/dotc/ast/Desugar.scala
index 0f158cbb5..b82bd47f6 100644
--- a/src/dotty/tools/dotc/ast/Desugar.scala
+++ b/src/dotty/tools/dotc/ast/Desugar.scala
@@ -721,8 +721,7 @@ object desugar {
* The result is used for validity checking, is thrown away afterwards.
*/
def refinedTypeToClass(tree: RefinedTypeTree)(implicit ctx: Context): TypeDef = {
- val parent = New(tree.tpt, Nil)
- val impl = Template(emptyConstructor, parent :: Nil, EmptyValDef, tree.refinements)
+ val impl = Template(emptyConstructor, tree.tpt :: Nil, EmptyValDef, tree.refinements)
TypeDef(Modifiers(), tpnme.REFINE_CLASS, impl)
}