Files
kotlin-fork/compiler/testData/ir/irText/expressions/intersectedSmartcastForExtensionReceiverWithSameConstructor.kt.txt
T
2024-02-16 10:19:38 +00:00

42 lines
863 B
Kotlin
Vendored

class Bar<T : Any?> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
fun <T : Any?> Bar<T>.parameterizedExt() {
}
fun Bar<Int>.specificExt() {
}
fun test_1_1(x: Any) {
x as Bar<String> /*~> Unit */
x /*as Bar<String> */ as Bar<Int> /*~> Unit */
x /*as Bar<Int> */.specificExt()
}
fun test_1_2(x: Any) {
x as Bar<Int> /*~> Unit */
x /*as Bar<Int> */ as Bar<String> /*~> Unit */
x /*as Bar<Int> */.specificExt()
}
fun test_2_1(x: Any) {
x as Bar<String> /*~> Unit */
x /*as Bar<String> */ as Bar<Int> /*~> Unit */
x /*as Bar<String> */.parameterizedExt<String>()
x /*as Bar<Int> */.parameterizedExt<Int>()
}
fun test_2_2(x: Any) {
x as Bar<Int> /*~> Unit */
x /*as Bar<Int> */ as Bar<String> /*~> Unit */
x /*as Bar<String> */.parameterizedExt<String>()
x /*as Bar<Int> */.parameterizedExt<Int>()
}