PSI Pattern Matching: Respect type arguments when matching calls

#KT-6496 Fixed
This commit is contained in:
Alexey Sedunov
2014-12-19 20:54:09 +03:00
parent 7579471859
commit a9a30a1b7d
7 changed files with 63 additions and 1 deletions
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun foo(c : Collection<String>){
c.filterTo(ArrayList<String>())<selection>{ it.length() > 1 }</selection>
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo(c : Collection<String>){
val function: (String) -> Boolean = { it.length() > 1 }
c.filterTo(ArrayList<String>(), function)
}
@@ -0,0 +1,19 @@
// DISABLE-ERRORS
class A
class B
fun foo<T>(klass: Class<T>) {
}
fun bar<T>(klass: Class<T>) {
}
fun main() {
foo(<selection>javaClass<A>()</selection>)
foo(javaClass<B>())
bar(javaClass<B>())
bar(javaClass<A>())
javaClass()
}
@@ -0,0 +1,3 @@
javaClass<A>()
javaClass<A>()