Introduce Unit-conversions for simple arguments

This commit is contained in:
Mikhail Zarechenskiy
2020-06-02 15:04:39 +03:00
parent f08a45f2d4
commit 71cbe97688
23 changed files with 484 additions and 6 deletions
@@ -0,0 +1,16 @@
// !LANGUAGE: +UnitConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
fun foo(f: () -> Unit) {}
fun <T> fooGeneric(f: (T) -> Unit): T = TODO()
fun bar(): String = ""
fun createCall(): () -> Int = TODO()
fun test(g: () -> String, h: (Float) -> String) {
foo(::bar)
foo { "something" }
foo(g)
fooGeneric(h)
}