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,16 @@
// !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)
foo(<!UNSUPPORTED_FEATURE!>f<!>)
foo(<!UNSUPPORTED_FEATURE!>s<!>)
}