diagnostics for deprecated syntax of function type parameter list
This commit is contained in:
Vendored
+1
-1
@@ -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 })
|
||||
+1
-1
@@ -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()}
|
||||
+1
-1
@@ -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)
|
||||
|
||||
+1
-1
@@ -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) =
|
||||
|
||||
Reference in New Issue
Block a user