[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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
+26
@@ -0,0 +1,26 @@
|
|||||||
|
fun box(): String {
|
||||||
|
KlassA({})
|
||||||
|
KlassB()
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
class KlassA(arg: (() -> Unit)?) {
|
||||||
|
var func: (() -> Unit)? = arg
|
||||||
|
init {
|
||||||
|
if (func != null) {
|
||||||
|
<!SMARTCAST_IMPOSSIBLE!>func<!>()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class KlassB {
|
||||||
|
var func: (() -> Unit)?
|
||||||
|
init {
|
||||||
|
if (true) {
|
||||||
|
func = {}
|
||||||
|
<!UNSAFE_IMPLICIT_INVOKE_CALL!>func<!>()
|
||||||
|
} else {
|
||||||
|
func = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
+26
@@ -0,0 +1,26 @@
|
|||||||
|
fun box(): String {
|
||||||
|
KlassA({})
|
||||||
|
KlassB()
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
class KlassA(arg: (() -> Unit)?) {
|
||||||
|
var func: (() -> Unit)? = arg
|
||||||
|
init {
|
||||||
|
if (func != null) {
|
||||||
|
<!UNSAFE_IMPLICIT_INVOKE_CALL!>func<!>()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class KlassB {
|
||||||
|
var func: (() -> Unit)?
|
||||||
|
init {
|
||||||
|
if (true) {
|
||||||
|
func = {}
|
||||||
|
<!UNSAFE_IMPLICIT_INVOKE_CALL!>func<!>()
|
||||||
|
} else {
|
||||||
|
func = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
fun box(): String {
|
||||||
|
Klass({})
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
class Klass(var func: (() -> Unit)?) {
|
||||||
|
init {
|
||||||
|
if (func != null) {
|
||||||
|
<!SMARTCAST_IMPOSSIBLE!>func<!>()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
fun box(): String {
|
||||||
|
Klass({})
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
class Klass(var func: (() -> Unit)?) {
|
||||||
|
init {
|
||||||
|
if (func != null) {
|
||||||
|
<!UNSAFE_IMPLICIT_INVOKE_CALL!>func<!>()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user