Introduce call checker for Unit-conversions

This commit is contained in:
Mikhail Zarechenskiy
2020-06-02 16:15:36 +03:00
parent 6b0a803d14
commit bfa648972f
14 changed files with 210 additions and 1 deletions
@@ -0,0 +1,29 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Test1 {
fun foo(f: () -> Int) {}
object Scope {
fun foo(f: () -> Unit) {}
fun test(f: () -> Int) {
<!DEBUG_INFO_CALL("fqName: Test1.foo; typeCall: function")!><!COMPATIBILITY_WARNING!>foo<!>(f)<!>
}
}
}
object Test2 {
fun interface KRunnable {
fun run()
}
fun foo(f: () -> Unit) {}
object Scope1 {
fun foo(f: KRunnable) {}
fun test(f: () -> Int) {
<!DEBUG_INFO_CALL("fqName: Test2.Scope1.foo; typeCall: function")!>foo(<!UNSUPPORTED_FEATURE!>f<!>)<!>
}
}
}