Extraction Engine: Do not extract type parameter if it's resolved in the target scope
#KT-7246 Fixed
This commit is contained in:
+13
@@ -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>
|
||||
}
|
||||
}
|
||||
+16
@@ -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>
|
||||
}
|
||||
}
|
||||
+14
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user