FE: add one more test related to KT-56511 with the relevant feature ON

This commit is contained in:
Mikhail Glukhikh
2023-03-14 10:15:37 +01:00
committed by Space Team
parent 41c868445c
commit e8232a7572
8 changed files with 66 additions and 15 deletions
@@ -0,0 +1,25 @@
// !LANGUAGE: -ProhibitSmartcastsOnPropertyFromAlienBaseClassInheritedInInvisibleClass
// RENDER_DIAGNOSTICS_FULL_TEXT
// MODULE: m1
// FILE: A.kt
open class Base(val x: Any)
// MODULE: m2(m1)
// FILE: B.kt
private class Derived : Base("123") {
fun foo() {
if (x is String) {
<!SMARTCAST_IMPOSSIBLE!>x<!>.length
}
}
}
internal class Internal : Base("456")
internal fun bar(i: Internal) {
if (i.x is String) {
<!SMARTCAST_IMPOSSIBLE!>i.x<!>.length
}
}