Extract Function: Use intersection type to compute candidate types for parameters

#KT-8103 Fixed
This commit is contained in:
Alexey Sedunov
2015-06-16 21:13:51 +03:00
parent 1a9003c325
commit d58112a32a
4 changed files with 36 additions and 1 deletions
@@ -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){}
@@ -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){}