Create from Usage: Respect smart-casts when suggesting parameter type candidates
#KT-6781 Fixed
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
fun test(o: Any) {
|
||||
if (o is String) foo(o)
|
||||
}
|
||||
|
||||
fun foo(o: String) {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
fun test(s: String?) {
|
||||
if (s == null) return
|
||||
foo(s)
|
||||
}
|
||||
|
||||
fun foo(s: String) {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
fun test(o: Any) {
|
||||
if (o is String) <caret>foo(o)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
fun test(s: String?) {
|
||||
if (s == null) return
|
||||
<caret>foo(s)
|
||||
}
|
||||
Reference in New Issue
Block a user