Deprecate smart cast on alien derived property #KT-48101 Fixed
This commit is contained in:
+3
-2
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitSmartcastsOnPropertyFromAlienBaseClass
|
||||
// MODULE: m1
|
||||
// FILE: A.kt
|
||||
|
||||
@@ -10,7 +11,7 @@ open class Generic<T>(val y: T)
|
||||
class Derived : Base("123") {
|
||||
fun foo() {
|
||||
if (x is String) {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.length // impossible since `x` is in another module. FE1.0 allows this due to KT-47225
|
||||
<!DEBUG_INFO_SMARTCAST, DEPRECATED_SMARTCAST!>x<!>.length // impossible since `x` is in another module. FE1.0 allows this due to KT-47225
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +20,7 @@ class MyGeneric : Generic<Number>(42) {
|
||||
private fun baz(arg: Int) {}
|
||||
fun bar() {
|
||||
if (y is Int) {
|
||||
baz(<!DEBUG_INFO_SMARTCAST!>y<!>) // impossible since `y` is in another module. FE1.0 allows this due to KT-47225
|
||||
baz(<!DEBUG_INFO_SMARTCAST, DEPRECATED_SMARTCAST!>y<!>) // impossible since `y` is in another module. FE1.0 allows this due to KT-47225
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user