[OI] Prefer candidate without @OverloadResolutionByLambdaReturnType
This commit is contained in:
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
// !LANGUAGE: -NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNUSED_EXPRESSION
|
||||
// ISSUE: KT-11265
|
||||
|
||||
// FILE: OverloadResolutionByLambdaReturnType.kt
|
||||
|
||||
package kotlin
|
||||
|
||||
annotation class OverloadResolutionByLambdaReturnType
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
import kotlin.OverloadResolutionByLambdaReturnType
|
||||
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
fun create(f: (Int) -> Int): Int = 1
|
||||
fun create(f: (Int) -> String): String = ""
|
||||
|
||||
fun takeString(s: String) {}
|
||||
|
||||
fun test_1() {
|
||||
val x = <!AMBIGUITY!>create<!> { "" }
|
||||
takeString("")
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
// !LANGUAGE: -NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNUSED_EXPRESSION
|
||||
// ISSUE: KT-11265
|
||||
|
||||
// FILE: OverloadResolutionByLambdaReturnType.kt
|
||||
|
||||
package kotlin
|
||||
|
||||
annotation class OverloadResolutionByLambdaReturnType
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
import kotlin.OverloadResolutionByLambdaReturnType
|
||||
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
fun create(f: (Int) -> Int): Int = 1
|
||||
fun create(f: (Int) -> String): String = ""
|
||||
|
||||
fun takeString(s: String) {}
|
||||
|
||||
fun test_1() {
|
||||
val x = create { "" }
|
||||
takeString("")
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package
|
||||
|
||||
@kotlin.OverloadResolutionByLambdaReturnType public fun create(/*0*/ f: (kotlin.Int) -> kotlin.Int): kotlin.Int
|
||||
public fun create(/*0*/ f: (kotlin.Int) -> kotlin.String): kotlin.String
|
||||
public fun takeString(/*0*/ s: kotlin.String): kotlin.Unit
|
||||
public fun test_1(): kotlin.Unit
|
||||
|
||||
package kotlin {
|
||||
|
||||
public final annotation class OverloadResolutionByLambdaReturnType : kotlin.Annotation {
|
||||
public constructor OverloadResolutionByLambdaReturnType()
|
||||
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