[tests] Add test data for KT-63705
This commit is contained in:
committed by
Space Team
parent
fb9bf1782e
commit
b275aeb39d
+29
@@ -0,0 +1,29 @@
|
||||
// IGNORE_BACKEND_K1: ANY
|
||||
// ISSUE: KT-63705
|
||||
|
||||
fun box(): String {
|
||||
KlassA({})
|
||||
KlassB()
|
||||
return "OK"
|
||||
}
|
||||
|
||||
class KlassA(arg: (() -> Unit)?) {
|
||||
val func: (() -> Unit)? = arg
|
||||
init {
|
||||
if (func != null) {
|
||||
func()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class KlassB {
|
||||
val func: (() -> Unit)?
|
||||
init {
|
||||
if (true) {
|
||||
func = {}
|
||||
func()
|
||||
} else {
|
||||
func = null
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// IGNORE_BACKEND_K1: ANY
|
||||
// ISSUE: KT-63705
|
||||
|
||||
fun box(): String {
|
||||
Klass({})
|
||||
return "OK"
|
||||
}
|
||||
|
||||
class Klass(val func: (() -> Unit)?) {
|
||||
init {
|
||||
if (func != null) {
|
||||
func()
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
fun box(): String {
|
||||
Klass({})
|
||||
return "OK"
|
||||
}
|
||||
|
||||
class Klass(func: (() -> Unit)?) {
|
||||
init {
|
||||
if (func != null) {
|
||||
func()
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
fun box(): String {
|
||||
Klass({})
|
||||
return "OK"
|
||||
}
|
||||
|
||||
class Klass {
|
||||
constructor(func: (() -> Unit)?) {
|
||||
if (func != null) {
|
||||
func()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user