mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 08:31:28 +00:00
A set of tests for KT-7561 on codegen side, including exotic inc() functions(). #KT-7561 Fixed.
13 lines
283 B
Kotlin
Vendored
13 lines
283 B
Kotlin
Vendored
class MyClass
|
|
|
|
// In principle it is not correct, MyClass? is not a subtype of MyClass
|
|
fun MyClass.inc(): MyClass? = null
|
|
|
|
public fun box() : String {
|
|
var i : MyClass?
|
|
i = MyClass()
|
|
val j = i++
|
|
|
|
return if (j is MyClass && null == i) "OK" else "fail i = $i j = $j"
|
|
}
|