Skip to content

Commit ff7ed07

Browse files
committed
1 parent 22cc628 commit ff7ed07

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ class JSCodeGen()(using genCtx: Context) {
13881388
*/
13891389
private def genSuperCall(tree: Apply, isStat: Boolean): js.Tree = {
13901390
implicit val pos = tree.span
1391-
val Apply(fun @ Select(sup @ Super(_, mix), _), args) = tree
1391+
val Apply(fun @ Select(sup @ Super(qual, _), _), args) = tree
13921392
val sym = fun.symbol
13931393

13941394
if (sym == defn.Any_getClass) {
@@ -1397,8 +1397,11 @@ class JSCodeGen()(using genCtx: Context) {
13971397
} else /*if (isScalaJSDefinedJSClass(currentClassSym)) {
13981398
genJSSuperCall(tree, isStat)
13991399
} else*/ {
1400+
/* #3013 `qual` can be `this.$outer()` in some cases since Scala 2.12,
1401+
* so we call `genExpr(qual)`, not just `genThis()`.
1402+
*/
14001403
val superCall = genApplyMethodStatically(
1401-
genThis()(sup.span), sym, genActualArgs(sym, args))
1404+
genExpr(qual), sym, genActualArgs(sym, args))
14021405

14031406
// Initialize the module instance just after the super constructor call.
14041407
if (isStaticModule(currentClassSym) && !isModuleInitialized &&

0 commit comments

Comments
 (0)