Join declaration & assignment is no more suggested in case of potential smart cast available #KT-15412 Fixed
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
// IS_APPLICABLE: true
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
val x: String<caret>
|
||||
x = System.getProperty("")
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// IS_APPLICABLE: true
|
||||
// WITH_RUNTIME
|
||||
fun foo() {
|
||||
val x: String = System.getProperty("")
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun foo() {
|
||||
val x: Any<caret>
|
||||
x = "123"
|
||||
x.length // Smart cast before join, error after join
|
||||
}
|
||||
Reference in New Issue
Block a user