Files
kotlin-fork/compiler/testData/diagnostics/tests/callableReference/noCompatibilityResolveWithProressiveModeForNI.kt
T
Mikhail Zarechenskiy 0c8b847ae6 Introduce compiler key to disable compatibility resolution mechanism
Enable it if one was using new inferene before 1.4

 #KT-40128 Fixed
 #KT-40112 Fixed
 #KT-40113 Fixed
2020-07-10 14:23:45 +03:00

19 lines
446 B
Kotlin
Vendored

// FIR_IDENTICAL
// !LANGUAGE: +DisableCompatibilityModeForNewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
fun bar(): Int = 0
object Scope {
fun <T> foo(f: () -> T): T = f()
fun bar(x: Int = 0): String = ""
fun test() {
val r1 = foo(::bar)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>r1<!>
val r2 = foo(Scope::bar)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>r2<!>
}
}