087edc026d
Before this commit, we discriminated particular candidates with SAM during resolution stages. More precisely, candidates from Kotlin which used Java SAM types, were discriminated allowing go up the tower for better candidates. After disabling compatibility mode for new inference, it's not so, but now we discriminate similar candidates in ConeOverloadConflictResolver. This does not allow going up the tower, but allows to select better candidate at similar tower level. Related to KT-63558, KT-64306
15 lines
366 B
Kotlin
Vendored
15 lines
366 B
Kotlin
Vendored
// FIR_IDENTICAL
|
|
// !LANGUAGE: -DisableCompatibilityModeForNewInference
|
|
// SKIP_TXT
|
|
// FULL_JDK
|
|
|
|
fun <T> bar(action: () -> T): T = action()
|
|
fun bar(action: java.lang.Runnable) { }
|
|
|
|
fun foo(): String = ""
|
|
|
|
fun main() {
|
|
val x = bar() { foo() } // OK with default current 1.5/1.6, Error with DisableCompatibilityModeForNewInference enabled, Ok in K2
|
|
x.length
|
|
}
|