diff options
author | Paul Phillips <paulp@improving.org> | 2011-10-29 19:35:15 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-10-29 19:35:15 +0000 |
commit | 2d3fe5733cbc6bcf06892c8ee3cb19f7987f6b6a (patch) | |
tree | 6e7418bf49e9bf8dbcd05e233cc5b5c5f84497cd /src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala | |
parent | 48a26b9c2be3cb5390dafa8a13620c91fab0167d (diff) | |
download | scala-2d3fe5733cbc6bcf06892c8ee3cb19f7987f6b6a.tar.gz scala-2d3fe5733cbc6bcf06892c8ee3cb19f7987f6b6a.tar.bz2 scala-2d3fe5733cbc6bcf06892c8ee3cb19f7987f6b6a.zip |
Fix for crasher in explicitouter.
Closes SI-4970, review by moors.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala index 1bc283841b..192c4e9b59 100644 --- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala +++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala @@ -346,12 +346,16 @@ abstract class ExplicitOuter extends InfoTransform * @pre mixinClass is an inner class */ def mixinOuterAccessorDef(mixinClass: Symbol): Tree = { - val outerAcc = outerAccessor(mixinClass) overridingSymbol currentClass - assert(outerAcc != NoSymbol) - val path = - if (mixinClass.owner.isTerm) THIS(mixinClass.owner.enclClass) - else gen.mkAttributedQualifier(currentClass.thisType baseType mixinClass prefix) - + val outerAcc = outerAccessor(mixinClass) overridingSymbol currentClass + def mixinPrefix = currentClass.thisType baseType mixinClass prefix; + assert(outerAcc != NoSymbol, "No outer accessor for inner mixin " + mixinClass + " in " + currentClass) + // I added the mixinPrefix.typeArgs.nonEmpty condition to address the + // crash in SI-4970. I feel quite sure this can be improved. + val path = ( + if (mixinClass.owner.isTerm) gen.mkAttributedThis(mixinClass.owner.enclClass) + else if (mixinPrefix.typeArgs.nonEmpty) gen.mkAttributedThis(mixinPrefix.typeSymbol) + else gen.mkAttributedQualifier(mixinPrefix) + ) localTyper typed { (DEF(outerAcc) withPos currentClass.pos) === { // Need to cast for nested outer refs in presence of self-types. See ticket #3274. |