Skip to content

Commit ad9aaca

Browse files
committed
1 parent 65ceaff commit ad9aaca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,7 @@ class JSCodeGen()(using genCtx: Context) {
14101410
*/
14111411
private def genSuperCall(tree: Apply, isStat: Boolean): js.Tree = {
14121412
implicit val pos = tree.span
1413-
val Apply(fun @ Select(sup @ Super(_, mix), _), args) = tree
1413+
val Apply(fun @ Select(sup @ Super(qual, _), _), args) = tree
14141414
val sym = fun.symbol
14151415

14161416
if (sym == defn.Any_getClass) {
@@ -1419,8 +1419,11 @@ class JSCodeGen()(using genCtx: Context) {
14191419
} else /*if (isScalaJSDefinedJSClass(currentClassSym)) {
14201420
genJSSuperCall(tree, isStat)
14211421
} else*/ {
1422+
/* #3013 `qual` can be `this.$outer()` in some cases since Scala 2.12,
1423+
* so we call `genExpr(qual)`, not just `genThis()`.
1424+
*/
14221425
val superCall = genApplyMethodStatically(
1423-
genThis()(sup.span), sym, genActualArgs(sym, args))
1426+
genExpr(qual), sym, genActualArgs(sym, args))
14241427

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

0 commit comments

Comments
 (0)