summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
index f2b896dc96..ee5bc040f5 100644
--- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
+++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
@@ -324,7 +324,9 @@ abstract class ExplicitOuter extends InfoTransform
val path =
if (mixinClass.owner.isTerm) THIS(mixinClass.owner.enclClass)
else gen.mkAttributedQualifier(currentClass.thisType baseType mixinClass prefix)
- val rhs = ExplicitOuterTransformer.this.transform(path)
+ // Need to cast for nested outer refs in presence of self-types. See ticket #3274.
+ val rhs = gen.mkAsInstanceOf(ExplicitOuterTransformer.this.transform(path),
+ outerAcc.info.resultType)
// @S: atPos not good enough because of nested atPos in DefDef method, which gives position from wrong class!
rhs setPos currentClass.pos