JVM_IR: Fix check for whether classes are from Java.

This allows us to not generate redundant immutable collection
stubs. The code to generate the immutable collection stubs does
not deal well with thinking that all external declarations
come from Java.
This commit is contained in:
Mads Ager
2019-12-19 15:38:21 +01:00
committed by max-kammerer
parent e261b1e2de
commit 51f726be9b
5 changed files with 16 additions and 8 deletions
@@ -1,5 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// IGNORE_LIGHT_ANALYSIS
+9 -1
View File
@@ -14,9 +14,12 @@ var v: Int = 1
fun consumeInt(x: Int) {}
class A {
open class A {
val OK: String = "OK"
@JvmName("OK") get
@JvmName("g")
fun <T> f(x: T, y: Int = 1) = x
}
annotation class Anno(@get:JvmName("uglyJvmName") val value: String)
@@ -25,6 +28,8 @@ annotation class Anno(@get:JvmName("uglyJvmName") val value: String)
import lib.*
class B : A()
@Anno("OK")
fun annotated() {}
@@ -36,5 +41,8 @@ fun box(): String {
val annoValue = (::annotated.annotations.single() as Anno).value
if (annoValue != "OK") return "Fail annotation value: $annoValue"
val b = B()
if (b.f("OK") != "OK") return "Fail call of annotated method"
return A().OK
}