Add 'operator' keyword

This commit is contained in:
Yan Zhulanow
2015-09-16 19:59:02 +03:00
parent 4a32993cc3
commit bc727a170b
58 changed files with 179 additions and 54 deletions
@@ -0,0 +1,5 @@
package test
class Example {
operator fun plus(other: Example) {}
}
@@ -0,0 +1,6 @@
package test
public final class Example {
/*primary*/ public constructor Example()
public final operator fun plus(/*0*/ other: test.Example): kotlin.Unit
}
@@ -5,7 +5,7 @@ fun bar(f: Int.()->Unit) {
Resolved call:
Resulting descriptor: fun Int.invoke(): Unit defined in kotlin.Function1
Resulting descriptor: operator fun Int.invoke(): Unit defined in kotlin.Function1
Explicit receiver kind = BOTH_RECEIVERS
Dispatch receiver = f {[@kotlin.Extension] Function1<Int, Unit>}
@@ -5,7 +5,7 @@ fun bar(f: ()->Unit) {
Resolved call:
Resulting descriptor: fun invoke(): Unit defined in kotlin.Function0
Resulting descriptor: operator fun invoke(): Unit defined in kotlin.Function0
Explicit receiver kind = DISPATCH_RECEIVER
Dispatch receiver = f {Function0<Unit>}
@@ -9,7 +9,7 @@ interface A {
Resolved call:
Resulting descriptor: fun Int.invoke(): Unit defined in kotlin.Function1
Resulting descriptor: operator fun Int.invoke(): Unit defined in kotlin.Function1
Explicit receiver kind = BOTH_RECEIVERS
Dispatch receiver = foo {[@kotlin.Extension] Function1<Int, Unit>}
@@ -9,7 +9,7 @@ fun test(a: A) {
Resolved call:
Resulting descriptor: fun invoke(p1: Int): Int defined in kotlin.Function1
Resulting descriptor: operator fun invoke(p1: Int): Int defined in kotlin.Function1
Explicit receiver kind = DISPATCH_RECEIVER
Dispatch receiver = foo {Function1<Int, Int>}