Skip to content

Commit e53f5cb

Browse files
committed
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.
1 parent 8b27ecb commit e53f5cb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -2227,10 +2227,7 @@ class JSCodeGen()(using genCtx: Context) {
22272227
val Apply(fun @ Select(sup @ Super(qual, _), _), args) = tree: @unchecked
22282228
val sym = fun.symbol
22292229

2230-
if (sym == defn.Any_getClass) {
2231-
// The only primitive that is also callable as super call
2232-
js.GetClass(genThis())
2233-
} else if (currentClassSym.isNonNativeJSClass) {
2230+
if (currentClassSym.isNonNativeJSClass) {
22342231
genJSSuperCall(tree, isStat)
22352232
} else {
22362233
/* #3013 `qual` can be `this.$outer()` in some cases since Scala 2.12,

0 commit comments

Comments
 (0)