Extract Function: Use intersection type to compute candidate types for parameters
#KT-8103 Fixed
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// PARAM_TYPES: kotlin.String
|
||||
// PARAM_DESCRIPTOR: value-parameter val p: kotlin.Any defined in foo
|
||||
|
||||
fun foo(p: Any) {
|
||||
if (p is String) {
|
||||
<selection>f(p)
|
||||
g(p)</selection>
|
||||
}
|
||||
}
|
||||
|
||||
fun f(s: String){}
|
||||
fun g(o: Any){}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// PARAM_TYPES: kotlin.String
|
||||
// PARAM_DESCRIPTOR: value-parameter val p: kotlin.Any defined in foo
|
||||
|
||||
fun foo(p: Any) {
|
||||
if (p is String) {
|
||||
__dummyTestFun__(p)
|
||||
}
|
||||
}
|
||||
|
||||
private fun __dummyTestFun__(p: String) {
|
||||
f(p)
|
||||
g(p)
|
||||
}
|
||||
|
||||
fun f(s: String){}
|
||||
fun g(o: Any){}
|
||||
Reference in New Issue
Block a user