FE: add one more test related to KT-56511 with the relevant feature ON
This commit is contained in:
committed by
Space Team
parent
41c868445c
commit
e8232a7572
+2
-2
@@ -1,10 +1,10 @@
|
||||
// -- Module: <m1> --
|
||||
|
||||
// -- Module: <m2> --
|
||||
/B.kt:13:13: warning: smart cast to 'String' is deprecated, because 'x' is a property declared in base class from different module inherited in non-public API class
|
||||
/B.kt:14:13: warning: smart cast to 'String' is deprecated, because 'x' is a property declared in base class from different module inherited in non-public API class
|
||||
x.length
|
||||
^
|
||||
/B.kt:22:9: warning: smart cast to 'String' is deprecated, because 'i.x' is a property declared in base class from different module inherited in non-public API class
|
||||
/B.kt:23:9: warning: smart cast to 'String' is deprecated, because 'i.x' is a property declared in base class from different module inherited in non-public API class
|
||||
i.x.length
|
||||
^
|
||||
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitSmartcastsOnPropertyFromAlienBaseClassInheritedInInvisibleClass
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
// MODULE: m1
|
||||
// FILE: A.kt
|
||||
@@ -19,6 +20,6 @@ internal class Internal : Base("456")
|
||||
|
||||
internal fun bar(i: Internal) {
|
||||
if (i.x is String) {
|
||||
i.x.length
|
||||
<!SMARTCAST_IMPOSSIBLE!>i.x<!>.length
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitSmartcastsOnPropertyFromAlienBaseClassInheritedInInvisibleClass
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
// MODULE: m1
|
||||
// FILE: A.kt
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ProhibitSmartcastsOnPropertyFromAlienBaseClassInheritedInInvisibleClass
|
||||
// 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user