summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/kotlin/Hello.kt21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/kotlin/Hello.kt b/src/main/kotlin/Hello.kt
new file mode 100644
index 0000000..6900933
--- /dev/null
+++ b/src/main/kotlin/Hello.kt
@@ -0,0 +1,21 @@
+fun b(func: B.()->Unit){B().func()}
+
+class B{
+ fun String.f(){
+ println("+$this")
+ }
+ operator fun unaryPlus(){
+ println("+++")
+ }
+}
+
+fun main(args: Array<String>) {
+
+ b{
+ "foo".f()
+ }
+
+ val bb=B()
+ +bb
+}
+