Files
kotlin-fork/compiler/testData/diagnostics/tests/unitConversion/unitConversionDisabledForSimpleArguments.fir.kt
T
2020-06-05 13:24:21 +03:00

16 lines
327 B
Kotlin
Vendored

// !LANGUAGE: -SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
fun foo(f: () -> Unit) {}
fun bar(): Int = 0
abstract class SubInt : () -> Int
fun test(f: () -> String, s: SubInt) {
foo { "lambda" }
foo(::bar)
<!INAPPLICABLE_CANDIDATE!>foo<!>(f)
<!INAPPLICABLE_CANDIDATE!>foo<!>(s)
}