Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.kt
T
Denis.Zharkov 00821bbc63 FIR: Update test data (repeated diagnostics)
They are a bit redundant, but it needs additional work to be done
to avoid them
2021-05-20 17:24:33 +03:00

42 lines
917 B
Kotlin
Vendored

fun interface MyRunnable {
fun foo(x: Int): Boolean
}
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface WithProperty {
<!FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES!>val<!> x: Int
}
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface TwoAbstract : MyRunnable {
fun bar()
}
fun interface Super {
fun foo(x: Int): Any
}
fun interface Derived : Super {
override fun foo(x: Int): Boolean
}
fun foo1(m: MyRunnable) {}
fun foo2(m: WithProperty) {}
fun foo3(m: TwoAbstract) {}
fun foo4(m: Derived) {}
fun main() {
val f = { t: Int -> t > 1}
foo1 { x -> x > 1 }
foo1(f)
foo2 <!ARGUMENT_TYPE_MISMATCH!>{ x -> x <!UNRESOLVED_REFERENCE!>><!> 1 }<!>
foo2(<!ARGUMENT_TYPE_MISMATCH!>f<!>)
foo3 <!ARGUMENT_TYPE_MISMATCH!>{ x -> x <!UNRESOLVED_REFERENCE!>><!> 1 }<!>
foo3(<!ARGUMENT_TYPE_MISMATCH!>f<!>)
foo4 { x -> x > 1 }
foo4(f)
}