diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2010-04-27 15:08:57 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2010-04-27 15:08:57 +0000 |
commit | f99b3ceac6465c630374e5bd5b680f4b99abc9b7 (patch) | |
tree | bb073b41bd825f9236647420c4f59da9631915b5 | |
parent | 15fecdc78e66bb93ff0db9f4cdcf50f9c85fc190 (diff) | |
download | scala-f99b3ceac6465c630374e5bd5b680f4b99abc9b7.tar.gz scala-f99b3ceac6465c630374e5bd5b680f4b99abc9b7.tar.bz2 scala-f99b3ceac6465c630374e5bd5b680f4b99abc9b7.zip |
Fixed crash when calling super in a closure (se...
Fixed crash when calling super in a closure (see #3312). Closes #3325.
No review.
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index 177469aece..2b45062c44 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -336,7 +336,6 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { if (sym.isTypeParameter && sym.hasAnnotation(SpecializedClass)) specializedTypeVars(args) + sym else if (sym.isTypeSkolem && sym.deSkolemize.hasAnnotation(SpecializedClass)) { - println("cought skolem without @specialized") specializedTypeVars(args) + sym } else specializedTypeVars(args) @@ -1147,7 +1146,12 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { symbol.enclClass, typeEnv(symbol.alias) ++ typeEnv(tree.symbol)) - case Apply(sel @ Select(sup @ Super(qual, name), name1), args) => + case Apply(sel @ Select(sup @ Super(qual, name), name1), args) + if (sup.symbol.info.parents != atPhase(phase.prev)(sup.symbol.info.parents)) => + + def parents = sup.symbol.info.parents + log(tree + " parents changed from: " + atPhase(phase.prev)(parents) + " to: " + parents) + val res = localTyper.typed( Apply(Select(Super(qual, name) setPos sup.pos, name1) setPos sel.pos, transformTrees(args)) setPos tree.pos) log("retyping call to super, from: " + symbol + " to " + res.symbol) |