Add test checking that fun isn't inherited from base interface

This commit is contained in:
Mikhail Zarechenskiy
2020-02-04 17:46:24 +03:00
parent 45bbdaf73f
commit a736551c2a
6 changed files with 80 additions and 0 deletions
@@ -0,0 +1,19 @@
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun interface Base {
fun invoke()
}
interface WithoutFun : Base
fun interface WithFun : Base
fun takeBase(b: Base) {}
fun takeWithoutFun(a: WithoutFun) {}
fun takeWithFun(a: WithFun) {}
fun test() {
takeBase {}
takeWithoutFun(<!TYPE_MISMATCH!>{}<!>)
takeWithFun {}
}