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,18 @@
// !LANGUAGE: +UnitConversion +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
fun interface SuspendRunnable {
suspend fun run()
}
fun foo(r: SuspendRunnable) {}
fun bar(): String = ""
abstract class SubInt : () -> Int
fun test(f: () -> String, s: SubInt) {
foo(f)
foo(s)
foo(::bar)
}