[NI] Set correct applicability for unknown lambda parameter diagnostic
Unknown lambda parameter should not change resolve. So the new diagnostic should not have error status; othrewise candidates with lower priority but more specific expected type may be chosen. KT-34335 Fixed See also KT-36264
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER
|
||||
|
||||
fun baz(f: (Int) -> String) {}
|
||||
|
||||
object Foo {
|
||||
fun baz(vararg anys: Any?) {}
|
||||
|
||||
fun testResolvedToMember() {
|
||||
baz({ x -> "" }) // should be an error
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER
|
||||
|
||||
fun baz(f: (Int) -> String) {}
|
||||
|
||||
object Foo {
|
||||
fun baz(vararg anys: Any?) {}
|
||||
|
||||
fun testResolvedToMember() {
|
||||
baz({ <!CANNOT_INFER_PARAMETER_TYPE!>x<!> -> "" }) // should be an error
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
public fun baz(/*0*/ f: (kotlin.Int) -> kotlin.String): kotlin.Unit
|
||||
|
||||
public object Foo {
|
||||
private constructor Foo()
|
||||
public final fun baz(/*0*/ vararg anys: kotlin.Any? /*kotlin.Array<out kotlin.Any?>*/): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun testResolvedToMember(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user