Improve diagnostic for unresolved reference when function expected
#KT-10657 Fixed
This commit is contained in:
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun Int.invoke(a: Int) {}
|
||||
fun Int.invoke(a: Int, b: Int) {}
|
||||
|
||||
class SomeClass
|
||||
|
||||
fun test(identifier: SomeClass, fn: String.() -> Unit) {
|
||||
<!FUNCTION_EXPECTED, DEBUG_INFO_MISSING_UNRESOLVED!>identifier<!>()
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>identifier<!>(123)
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>identifier<!>(1, 2)
|
||||
1.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>fn<!>()
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ identifier: SomeClass, /*1*/ fn: kotlin.String.() -> kotlin.Unit): kotlin.Unit
|
||||
public fun kotlin.Int.invoke(/*0*/ a: kotlin.Int): kotlin.Unit
|
||||
public fun kotlin.Int.invoke(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int): kotlin.Unit
|
||||
|
||||
public final class SomeClass {
|
||||
public constructor SomeClass()
|
||||
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 open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun Int.invoke() {}
|
||||
|
||||
class SomeClass
|
||||
|
||||
fun test(identifier: SomeClass, fn: String.() -> Unit) {
|
||||
<!FUNCTION_EXPECTED, DEBUG_INFO_MISSING_UNRESOLVED!>identifier<!>()
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>identifier<!>(123)
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>identifier<!>(1, 2)
|
||||
1.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>fn<!>()
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ identifier: SomeClass, /*1*/ fn: kotlin.String.() -> kotlin.Unit): kotlin.Unit
|
||||
public fun kotlin.Int.invoke(): kotlin.Unit
|
||||
|
||||
public final class SomeClass {
|
||||
public constructor SomeClass()
|
||||
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 open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user