Files
kotlin-fork/compiler/testData/diagnostics/tests/samConversions/samPriorityVsGenericCompatibilityDisabled.kt
T
Denis.Zharkov 056657525e FIR: Temporary support FE 1.0 behavior for SAM vs. generic ambiguity
^KT-48300 Relates
^KT-48938 Fixed
2021-10-14 14:01:50 +03:00

15 lines
383 B
Kotlin
Vendored

// !LANGUAGE: +DisableCompatibilityModeForNewInference
// SKIP_TXT
// FIR_IDENTICAL
// 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
x.<!UNRESOLVED_REFERENCE!>length<!>
}