Skip to content

Commit c0d21ec

Browse files
sjrdtgodzik
authored andcommitted
Scala.js: Remove an old special case for Any.getClass().
`getClass()` hasn't been a primitive per se for a long time. It is a regular method of `jl.Object` whose *body* uses a primitive operation. [Cherry-picked e53f5cb]
1 parent b07935a commit c0d21ec

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,10 +2180,7 @@ class JSCodeGen()(using genCtx: Context) {
21802180
val Apply(fun @ Select(sup @ Super(qual, _), _), args) = tree: @unchecked
21812181
val sym = fun.symbol
21822182

2183-
if (sym == defn.Any_getClass) {
2184-
// The only primitive that is also callable as super call
2185-
js.GetClass(genThis())
2186-
} else if (currentClassSym.isNonNativeJSClass) {
2183+
if (currentClassSym.isNonNativeJSClass) {
21872184
genJSSuperCall(tree, isStat)
21882185
} else {
21892186
/* #3013 `qual` can be `this.$outer()` in some cases since Scala 2.12,

0 commit comments

Comments
 (0)