diff options
author | Martin Odersky <odersky@gmail.com> | 2015-12-30 16:06:34 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-01-18 16:49:16 +0100 |
commit | c0b545be494bc53f9839c8301cdca71edeb620c7 (patch) | |
tree | 4ff0a9e473d7a63d8c11533331d6560412035781 /src/dotty/tools/dotc/transform/PostTyper.scala | |
parent | dd733181fd943f5074af57b151da95df7c999fc9 (diff) | |
download | dotty-c0b545be494bc53f9839c8301cdca71edeb620c7.tar.gz dotty-c0b545be494bc53f9839c8301cdca71edeb620c7.tar.bz2 dotty-c0b545be494bc53f9839c8301cdca71edeb620c7.zip |
Keep rhs of TypeDef in typed tree
This is important for IDEs who want to see the full tree.
The tree now gets replaced by a TypeTree in PostTyper.
Diffstat (limited to 'src/dotty/tools/dotc/transform/PostTyper.scala')
-rw-r--r-- | src/dotty/tools/dotc/transform/PostTyper.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/transform/PostTyper.scala b/src/dotty/tools/dotc/transform/PostTyper.scala index 3266d3a02..edf97f5b8 100644 --- a/src/dotty/tools/dotc/transform/PostTyper.scala +++ b/src/dotty/tools/dotc/transform/PostTyper.scala @@ -180,6 +180,15 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisTran case tree: DefDef => transformAnnots(tree) superAcc.wrapDefDef(tree)(super.transform(tree).asInstanceOf[DefDef]) + case tree: TypeDef => + transformAnnots(tree) + val sym = tree.symbol + val tree1 = + if (sym.isClass) tree + else { + cpy.TypeDef(tree)(rhs = TypeTree(tree.symbol.info)) + } + super.transform(tree1) case tree: MemberDef => transformAnnots(tree) super.transform(tree) |