summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames Iry <jamesiry@gmail.com>2013-02-19 15:24:37 -0800
committerJames Iry <jamesiry@gmail.com>2013-02-19 15:24:37 -0800
commit83011a88d040eb5be16c2dfd9d4cc608e1f5f442 (patch)
tree66b2c2e75ca9126436f00288bdb53bdbc65db45c /src
parent5d6e02ee2eb1b454d88d3c3fb41d4715930caa9d (diff)
parent93976204ba533e7413b61fd103384c76d0629ce0 (diff)
downloadscala-83011a88d040eb5be16c2dfd9d4cc608e1f5f442.tar.gz
scala-83011a88d040eb5be16c2dfd9d4cc608e1f5f442.tar.bz2
scala-83011a88d040eb5be16c2dfd9d4cc608e1f5f442.zip
Merge pull request #2118 from lrytz/annotatedRetyping
Fix typing idempotency bug with Annotated trees
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index f97582f45c..9dde952d25 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -4153,15 +4153,11 @@ trait Typers extends Modes with Adaptations with Tags {
def resultingTypeTree(tpe: Type) = {
// we need symbol-ful originals for reification
// hence we go the extra mile to hand-craft tis guy
- val original =
- if (arg1.isType)
- arg1 match {
- case tt @ TypeTree() => Annotated(ann, tt.original)
- // this clause is needed to correctly compile stuff like "new C @D" or "@(inline @getter)"
- case _ => Annotated(ann, arg1)
- }
- else
- tree
+ val original = arg1 match {
+ case tt @ TypeTree() => Annotated(ann, tt.original)
+ // this clause is needed to correctly compile stuff like "new C @D" or "@(inline @getter)"
+ case _ => Annotated(ann, arg1)
+ }
original setType ann.tpe
TypeTree(tpe) setOriginal original setPos tree.pos.focus
}