diagnostics for deprecated syntax of function type parameter list
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
fun foo<T>(t: T) = t
|
||||
fun <T> foo(t: T) = t
|
||||
|
||||
fun test(map: MutableMap<Int, Int>, t: Int) {
|
||||
map [t] = foo(t) // t was marked with black square
|
||||
|
||||
compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedForVariableAsFunctionCall.kt
Vendored
+1
-1
@@ -9,7 +9,7 @@ class B {
|
||||
operator fun <T> invoke(<!UNUSED_PARAMETER!>f<!>: (T) -> T): MyFunc<T> = throw Exception()
|
||||
}
|
||||
|
||||
fun id<R>(r: R) = r
|
||||
fun <R> id(r: R) = r
|
||||
|
||||
fun foo(a: A) {
|
||||
val <!UNUSED_VARIABLE!>r<!> : MyFunc<Int> = id (a.b { x -> x + 14 })
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ package aaa
|
||||
|
||||
fun <T> T.foo(t: T) = t
|
||||
|
||||
fun id<T>(t: T) = t
|
||||
fun <T> id(t: T) = t
|
||||
|
||||
fun a() {
|
||||
val i = id(2 foo 3)
|
||||
|
||||
@@ -3,7 +3,7 @@ package b
|
||||
|
||||
import java.util.ArrayList
|
||||
|
||||
public fun query<T>(<!UNUSED_PARAMETER!>t<!>: T, <!UNUSED_PARAMETER!>args<!>: Map<String, Any>): List<T> {
|
||||
public fun <T> query(<!UNUSED_PARAMETER!>t<!>: T, <!UNUSED_PARAMETER!>args<!>: Map<String, Any>): List<T> {
|
||||
return ArrayList<T>()
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ fun test(pair: Pair<String, Int>) {
|
||||
|
||||
|
||||
//from standard library
|
||||
fun mapOf<K, V>(vararg <!UNUSED_PARAMETER!>values<!>: Pair<K, V>): Map<K, V> { throw Exception() }
|
||||
fun <K, V> mapOf(vararg <!UNUSED_PARAMETER!>values<!>: Pair<K, V>): Map<K, V> { throw Exception() }
|
||||
|
||||
fun <A,B> A.to(<!UNUSED_PARAMETER!>that<!>: B): Pair<A, B> { throw Exception() }
|
||||
|
||||
@@ -26,7 +26,7 @@ fun println(<!UNUSED_PARAMETER!>message<!> : Any?) { throw Exception() }
|
||||
class Pair<out A, out B> () {}
|
||||
|
||||
//short example
|
||||
fun foo<T>(t: T) = t
|
||||
fun <T> foo(t: T) = t
|
||||
|
||||
fun test(t: String) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user