Skip to content

Commit

Permalink
Port scala.js changes
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Jul 22, 2020
1 parent 22cc628 commit ff7ed07
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ class JSCodeGen()(using genCtx: Context) {
*/
private def genSuperCall(tree: Apply, isStat: Boolean): js.Tree = {
implicit val pos = tree.span
val Apply(fun @ Select(sup @ Super(_, mix), _), args) = tree
val Apply(fun @ Select(sup @ Super(qual, _), _), args) = tree
val sym = fun.symbol

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

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

0 comments on commit ff7ed07

Please sign in to comment.