'async' reserved in front of function literals

This commit is contained in:
Andrey Breslav
2015-12-17 20:52:08 +03:00
parent 75ab0dd509
commit 6155d836a5
4 changed files with 41 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
fun async(f: () -> Unit) {
f()
}
infix fun Any.async(f: () -> Unit) = f()
fun test(foo: Any) {
<!UNSUPPORTED!>async<!> { }
<!UNSUPPORTED!>async<!> /**/ { }
foo <!UNSUPPORTED!>async<!> { }
async() { }
async({ })
foo async ({ })
foo <!UNSUPPORTED!>async<!> fun () {}
foo async (fun () {})
async (fun () {})
}
+5
View File
@@ -0,0 +1,5 @@
package
public fun async(/*0*/ f: () -> kotlin.Unit): kotlin.Unit
public fun test(/*0*/ foo: kotlin.Any): kotlin.Unit
public infix fun kotlin.Any.async(/*0*/ f: () -> kotlin.Unit): kotlin.Unit