Extraction Engine: Do not extract type parameter if it's resolved in the target scope

#KT-7246 Fixed
This commit is contained in:
Alexey Sedunov
2015-05-12 12:44:34 +03:00
parent 7045140d11
commit b69b66feab
12 changed files with 197 additions and 48 deletions
@@ -0,0 +1,13 @@
// EXTRACTION_TARGET: property with getter
// WITH_RUNTIME
import java.util.*
// SIBLING:
class Foo<T> {
val map = HashMap<String, T>()
fun test(): T {
return <selection>map[""]</selection>
}
}
@@ -0,0 +1,16 @@
// EXTRACTION_TARGET: property with getter
// WITH_RUNTIME
import java.util.*
private val <T> Foo<T>.t: T?
get() = map[""]
// SIBLING:
class Foo<T> {
val map = HashMap<String, T>()
fun test(): T {
return t
}
}
@@ -0,0 +1,12 @@
// EXTRACTION_TARGET: property with initializer
// WITH_RUNTIME
import java.util.*
class Foo<T> {
val map = HashMap<String, T>()
fun test(): T {
return <selection>map[""]</selection>
}
}
@@ -0,0 +1,14 @@
// EXTRACTION_TARGET: property with initializer
// WITH_RUNTIME
import java.util.*
class Foo<T> {
val map = HashMap<String, T>()
private val t = map[""]
fun test(): T {
return t
}
}