[Wasm] Copy property reference lowering from K/N

This commit is contained in:
Svyatoslav Kuzmich
2021-09-27 17:07:39 +03:00
parent 33314b25c0
commit 5c05ff48ff
93 changed files with 376 additions and 151 deletions
@@ -1,6 +1,4 @@
// WITH_RUNTIME
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
fun foo(it: Int) = "O"[it]
val Int.foo: Char
@@ -1,5 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// WASM_MUTE_REASON: BINDING_RECEIVERS
open class A {
var f: String = "OK"
}
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
var result = ""
class A {
@@ -1,5 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// TODO: investigate should it be ran for JS or not
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// KT-30629
abstract class BaseFragment<T : BaseViewModel> {
@@ -1,5 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// WASM_MUTE_REASON: CLASS_REFERENCES
class Generic<P : Any>(val p: P)
class Host {
@@ -1,5 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// WASM_MUTE_REASON: UNKNOWN
// SKIP_SOURCEMAP_REMAPPING
fun box(): String {
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// IGNORE_BACKEND: NATIVE
class A(var v: Int) {
fun f(x: Int) = x * v
@@ -1,5 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// WASM_MUTE_REASON: BINDING_RECEIVERS
val String?.ok: String
get() = "OK"
@@ -1,5 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// WASM_MUTE_REASON: BINDING_RECEIVERS
fun box(): String {
val f = "kotlin"::length
val result = f.get()
@@ -1,8 +1,6 @@
// WITH_RUNTIME
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// JVM_TARGET: 1.8
// ^ This test causes SIGSEGV on JDK 1.6 with old back-end.
@@ -1,7 +1,5 @@
// IGNORE_BACKEND: JVM
// WITH_RUNTIME
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
val <T> T.foo get() = 42
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
abstract class Base {
val result = "OK"
}
@@ -1,5 +1,3 @@
// IGNORE_BACKEND: WASM
// WITH_RUNTIME
// FILE: b.kt
import a.A
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
import kotlin.reflect.KProperty
val four: Int by NumberDecrypter
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
import kotlin.reflect.KProperty
var result: String by Delegate
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
enum class E {
I
}
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
val Array<String>.firstElement: String get() = get(0)
fun box(): String {
@@ -1,6 +1,4 @@
// !LANGUAGE: -ForbidUsingExtensionPropertyTypeParameterInDelegate
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// IGNORE_BACKEND: NATIVE
//For KT-6020
import kotlin.reflect.KProperty1
@@ -1,6 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
import kotlin.reflect.KProperty1
class Q {
@@ -1,5 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// WASM_MUTE_REASON: BINDING_RECEIVERS
var x = "OK"
class C(init: () -> String) {
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
var state = ""
var topLevel: Int
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// Name of the getter should be 'getaBcde' according to JavaBean conventions
var aBcde: Int = 239
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
import kotlin.reflect.KProperty1
class A {
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// KT-12044 Assertion "Rewrite at slice LEXICAL_SCOPE" for 'if' with property references
fun box(): String {
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
class Foo {
protected var x = 0
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
data class Foo(var bar: Int?)
fun box(): String {
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
var recivier : Any? = "fail"
var value2 : Any? = "fail2"
@@ -1,5 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// WASM_MUTE_REASON: STDLIB_LAZY
//WITH_RUNTIME
fun box(): String {
@@ -1,5 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// WASM_MUTE_REASON: STDLIB_COLLECTIONS
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
open class Base {
open val foo = "Base"
}
@@ -1,5 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// WASM_MUTE_REASON: BINDING_RECEIVERS
class A {
var value: String = "fail1"
private set
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
import kotlin.reflect.KMutableProperty
class Bar(name: String) {
@@ -1,5 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// WASM_MUTE_REASON: BINDING_RECEIVERS
// See KT-12337 Reference to property with invisible setter should not be a KMutableProperty
import kotlin.reflect.KProperty1
@@ -1,5 +1,5 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
// WASM_MUTE_REASON: BINDING_RECEIVERS
// WITH_REFLECT
import kotlin.reflect.KProperty0
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
val String.id: String
get() = this
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
class A(val x: Int)
fun box(): String {
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
var storage = 0
var Int.foo: Int
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
data class Box(var value: String)
fun box(): String {
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
data class Box(val value: String)
var pr = Box("first")
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: PROPERTY_REFERENCES
data class Box(val value: String)
val foo = Box("lol")