diagnostics for deprecated syntax of function type parameter list

This commit is contained in:
Dmitry Jemerov
2015-10-05 20:26:47 +02:00
parent c5d3673b6b
commit 7c20630272
156 changed files with 236 additions and 213 deletions
@@ -2,6 +2,6 @@
fun <T> foo(f: () -> Collection<T>, p: (T) -> Boolean): Collection<T> = throw Exception()
fun emptyList<T>(): List<T> = throw Exception()
fun <T> emptyList(): List<T> = throw Exception()
fun test(): Collection<Int> = foo({ emptyList<Int>() }, { x -> x > 0 })
@@ -7,4 +7,4 @@ fun test() {
<!NONE_APPLICABLE!>foo<!>(<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyList<!>())
}
fun emptyList<T>(): List<T> {throw Exception()}
fun <T> emptyList(): List<T> {throw Exception()}
@@ -15,7 +15,7 @@ fun foo(s: String, f: (String, String)->Int) = f(s, s)
//appropriate function
fun foo(i: Int, f: (Int)->Int) = f(i)
fun id<T>(t: T) = t
fun <T> id(t: T) = t
fun test() {
foo(1, id { x1 ->
@@ -6,12 +6,12 @@ class A {
}
//inappropriate but participating in resolve functions
fun foo<T>(a: T, <!UNUSED_PARAMETER!>b<!>: T, <!UNUSED_PARAMETER!>i<!>: Int) = a
fun <T> foo(a: T, <!UNUSED_PARAMETER!>b<!>: T, <!UNUSED_PARAMETER!>i<!>: Int) = a
fun foo(a: Any) = a
fun foo<T>(a: T, <!UNUSED_PARAMETER!>b<!>: String) = a
fun foo<T>(a: T, <!UNUSED_PARAMETER!>b<!>: T, <!UNUSED_PARAMETER!>s<!>: String) = a
fun <T> foo(a: T, <!UNUSED_PARAMETER!>b<!>: String) = a
fun <T> foo(a: T, <!UNUSED_PARAMETER!>b<!>: T, <!UNUSED_PARAMETER!>s<!>: String) = a
//appropriate function
fun foo<T>(a: T, <!UNUSED_PARAMETER!>b<!>: T) = a
fun <T> foo(a: T, <!UNUSED_PARAMETER!>b<!>: T) = a
fun test(a: A) {
//the problem occurs if there are nested function invocations to resolve (resolve for them is repeated now)
@@ -18,7 +18,7 @@ fun foo(a: Any, f: (Any) -> Int) = f(a)
//appropriate function
fun foo(i: Int, f: (Int) -> Int) = f(i)
fun id<T>(t: T) = t
fun <T> id(t: T) = t
fun test() {
foo(1, id(fun(x1: Int) =