summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-05-17 16:17:10 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-05-17 16:21:09 +0200
commitc09bd7cbe853062853fab0692da1f54135fdbd38 (patch)
tree15549d73f72ac1ba2dbf86b5a47cab8dff2e274d /src
parent9fe251e16b93d4bdc8a496f3edce90ef2e207ee8 (diff)
downloadscala-c09bd7cbe853062853fab0692da1f54135fdbd38.tar.gz
scala-c09bd7cbe853062853fab0692da1f54135fdbd38.tar.bz2
scala-c09bd7cbe853062853fab0692da1f54135fdbd38.zip
A band-aid solution for SI-5803.
Since ae5ff662, resetAttrs duplicates trees, which doesn't preserve ApplyConstructor. My attempt to modify TreeCopier to do so proved trickier than expected. In any case, ApplyConstructor is not long for this world, and is only used in tree printing to distinguish `new X` from regular Apply trees, so this should suffice pending full surgery.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/ast/Trees.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala
index 4c509778e9..1b8fe9a91a 100644
--- a/src/compiler/scala/tools/nsc/ast/Trees.scala
+++ b/src/compiler/scala/tools/nsc/ast/Trees.scala
@@ -362,7 +362,8 @@ trait Trees extends reflect.internal.Trees { self: Global =>
}
val x1 = new Transformer().transform(x)
- assert(x.getClass isInstance x1, x1.getClass)
+ // The loose invariant is a temporary workaround for SI-5803
+ assert(x.getClass.isInstance(x1) || (x.isInstanceOf[ApplyConstructor] && x1.isInstanceOf[Apply]), (x.getClass, x1.getClass))
x1.asInstanceOf[T]
}
}