Fix tests ('infix')

This commit is contained in:
Yan Zhulanow
2015-09-30 21:27:45 +03:00
parent 7e8674c6ee
commit 1b01e7a85a
65 changed files with 146 additions and 132 deletions
+12
View File
@@ -8,6 +8,12 @@ class Example {
infix fun Example.toExt(other: Example) = Pair(this, other)
fun Example.toExtNonInfix(other: Example) = Pair(this, other)
infix fun Example.toExtWithExtraParams(other: Example, blah: Int = 0) = Pair(this, other)
fun Example.toExtNonInfixWithExtraParams(other: Example, blah: Int = 0) = Pair(this, other)
infix fun Example.toExtDefaultValues(other: Example? = null, blah: Int = 0) = Pair(this, other)
fun Example.toExtNonInfixDefaultValues(other: Example? = null, blah: Int = 0) = Pair(this, other)
fun Example.withLambda(f: () -> Unit) = Pair(this, f)
fun test() {
@@ -22,5 +28,11 @@ fun test() {
a <!INFIX_MODIFIER_REQUIRED!>toExtNonInfix<!> b
a.toExtNonInfix(b)
a toExtWithExtraParams b
a <!INFIX_MODIFIER_REQUIRED!>toExtNonInfixWithExtraParams<!> b
a toExtDefaultValues b
a <!INFIX_MODIFIER_REQUIRED!>toExtNonInfixDefaultValues<!> b
a <!INFIX_MODIFIER_REQUIRED!>withLambda<!> { }
}