Fix compiler tests
This commit is contained in:
+2
-2
@@ -2,10 +2,10 @@
|
||||
package kt1820
|
||||
|
||||
class MyInt(val i: Int) {
|
||||
fun plus(m: MyInt) : MyInt = MyInt(m.i + i)
|
||||
operator fun plus(m: MyInt) : MyInt = MyInt(m.i + i)
|
||||
}
|
||||
|
||||
fun Any.plusAssign(<!UNUSED_PARAMETER!>a<!>: Any) {}
|
||||
operator fun Any.plusAssign(<!UNUSED_PARAMETER!>a<!>: Any) {}
|
||||
|
||||
fun test(m: MyInt) {
|
||||
m += m
|
||||
|
||||
+2
-2
@@ -2,14 +2,14 @@ package
|
||||
|
||||
package kt1820 {
|
||||
public fun test(/*0*/ m: kt1820.MyInt): kotlin.Unit
|
||||
public fun kotlin.Any.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit
|
||||
public operator fun kotlin.Any.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit
|
||||
|
||||
public final class MyInt {
|
||||
public constructor MyInt(/*0*/ i: kotlin.Int)
|
||||
public final val i: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun plus(/*0*/ m: kt1820.MyInt): kt1820.MyInt
|
||||
public final operator fun plus(/*0*/ m: kt1820.MyInt): kt1820.MyInt
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -1,9 +1,9 @@
|
||||
class A {
|
||||
fun plusAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun minusAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun timesAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun divAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
fun modAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
operator fun plusAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
operator fun minusAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
operator fun timesAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
operator fun divAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
operator fun modAssign(<!UNUSED_PARAMETER!>x<!>: Int) {}
|
||||
}
|
||||
|
||||
fun testVal() {
|
||||
@@ -24,11 +24,11 @@ fun testExpr() {
|
||||
}
|
||||
|
||||
class B {
|
||||
fun plus(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
|
||||
fun minus(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
|
||||
fun times(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
|
||||
fun div(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
|
||||
fun mod(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
|
||||
operator fun plus(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
|
||||
operator fun minus(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
|
||||
operator fun times(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
|
||||
operator fun div(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
|
||||
operator fun mod(<!UNUSED_PARAMETER!>x<!>: Int): B = B()
|
||||
}
|
||||
|
||||
fun testWrong() {
|
||||
|
||||
+10
-10
@@ -6,24 +6,24 @@ public fun testWrong(): kotlin.Unit
|
||||
|
||||
public final class A {
|
||||
public constructor A()
|
||||
public final fun divAssign(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
public final operator fun divAssign(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun minusAssign(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
public final fun modAssign(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
public final fun plusAssign(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
public final fun timesAssign(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
public final operator fun minusAssign(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
public final operator fun modAssign(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
public final operator fun plusAssign(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
public final operator fun timesAssign(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class B {
|
||||
public constructor B()
|
||||
public final fun div(/*0*/ x: kotlin.Int): B
|
||||
public final operator fun div(/*0*/ x: kotlin.Int): B
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun minus(/*0*/ x: kotlin.Int): B
|
||||
public final fun mod(/*0*/ x: kotlin.Int): B
|
||||
public final fun plus(/*0*/ x: kotlin.Int): B
|
||||
public final fun times(/*0*/ x: kotlin.Int): B
|
||||
public final operator fun minus(/*0*/ x: kotlin.Int): B
|
||||
public final operator fun mod(/*0*/ x: kotlin.Int): B
|
||||
public final operator fun plus(/*0*/ x: kotlin.Int): B
|
||||
public final operator fun times(/*0*/ x: kotlin.Int): B
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -32,11 +32,11 @@ fun shortBinEq() {
|
||||
}
|
||||
|
||||
class A {
|
||||
fun plus(x : A) : A { return x }
|
||||
operator fun plus(x : A) : A { return x }
|
||||
}
|
||||
|
||||
class B {
|
||||
fun plus(x : A) : A { return x }
|
||||
operator fun plus(x : A) : A { return x }
|
||||
}
|
||||
|
||||
fun overloading() {
|
||||
|
||||
Vendored
+2
-2
@@ -8,7 +8,7 @@ public final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun plus(/*0*/ x: A): A
|
||||
public final operator fun plus(/*0*/ x: A): A
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@ public final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun plus(/*0*/ x: A): A
|
||||
public final operator fun plus(/*0*/ x: A): A
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class C {
|
||||
fun compareTo(c: C): Int? = null
|
||||
operator fun compareTo(c: C): Int? = null
|
||||
}
|
||||
|
||||
fun test(c: C) {
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ public fun test(/*0*/ c: C): kotlin.Unit
|
||||
|
||||
public final class C {
|
||||
public constructor C()
|
||||
public final fun compareTo(/*0*/ c: C): kotlin.Int?
|
||||
public final operator fun compareTo(/*0*/ c: C): kotlin.Int?
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
@@ -7,8 +7,8 @@ class event<T>()
|
||||
{
|
||||
val callbacks = ArrayList< Function1<T, Unit> >() // Should be ArrayList<()->Unit>, bug posted
|
||||
|
||||
fun plusAssign(f : (T) -> Unit) = callbacks.add(f)
|
||||
fun minusAssign(f : (T) -> Unit) = callbacks.remove(f)
|
||||
operator fun plusAssign(f : (T) -> Unit) = callbacks.add(f)
|
||||
operator fun minusAssign(f : (T) -> Unit) = callbacks.remove(f)
|
||||
fun call(value : T) { for(c in callbacks) c(value) }
|
||||
}
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ package kt1028 {
|
||||
public final fun call(/*0*/ value: T): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun minusAssign(/*0*/ f: (T) -> kotlin.Unit): kotlin.Boolean
|
||||
public final fun plusAssign(/*0*/ f: (T) -> kotlin.Unit): kotlin.Boolean
|
||||
public final operator fun minusAssign(/*0*/ f: (T) -> kotlin.Unit): kotlin.Boolean
|
||||
public final operator fun plusAssign(/*0*/ f: (T) -> kotlin.Unit): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
public class A {
|
||||
public fun get(vararg attrs : Pair<String, String>) : A = this
|
||||
public operator fun get(vararg attrs : Pair<String, String>) : A = this
|
||||
}
|
||||
fun String.plus() : A = A()
|
||||
fun A.div(s : String) : A = A()
|
||||
operator fun String.plus() : A = A()
|
||||
operator fun A.div(s : String) : A = A()
|
||||
|
||||
fun test() {
|
||||
(+"node2" / "node3" / "zzz") ["attr" to "value", "a2" to "v2"]
|
||||
@@ -12,9 +12,9 @@ fun test() {
|
||||
|
||||
//---------
|
||||
class B {
|
||||
public fun get(s : String, q : String) : B = this
|
||||
public fun get(s : Pair<String, String>) : B = this
|
||||
public fun invoke(q : B.() -> Unit) : B = this
|
||||
public operator fun get(s : String, q : String) : B = this
|
||||
public operator fun get(s : Pair<String, String>) : B = this
|
||||
public operator fun invoke(q : B.() -> Unit) : B = this
|
||||
}
|
||||
val x = B()["a", "v"]["a" to "b"] {} ["q" to "p"] // does not parses around {}
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@ package
|
||||
|
||||
public val x: B
|
||||
public fun test(): kotlin.Unit
|
||||
public fun A.div(/*0*/ s: kotlin.String): A
|
||||
public fun kotlin.String.plus(): A
|
||||
public operator fun A.div(/*0*/ s: kotlin.String): A
|
||||
public operator fun kotlin.String.plus(): A
|
||||
public fun </*0*/ A, /*1*/ B> A.to(/*0*/ that: B): Pair<A, B>
|
||||
|
||||
public final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun get(/*0*/ vararg attrs: Pair<kotlin.String, kotlin.String> /*kotlin.Array<out Pair<kotlin.String, kotlin.String>>*/): A
|
||||
public final operator fun get(/*0*/ vararg attrs: Pair<kotlin.String, kotlin.String> /*kotlin.Array<out Pair<kotlin.String, kotlin.String>>*/): A
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -17,10 +17,10 @@ public final class A {
|
||||
public final class B {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun get(/*0*/ s: Pair<kotlin.String, kotlin.String>): B
|
||||
public final fun get(/*0*/ s: kotlin.String, /*1*/ q: kotlin.String): B
|
||||
public final operator fun get(/*0*/ s: Pair<kotlin.String, kotlin.String>): B
|
||||
public final operator fun get(/*0*/ s: kotlin.String, /*1*/ q: kotlin.String): B
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun invoke(/*0*/ q: B.() -> kotlin.Unit): B
|
||||
public final operator fun invoke(/*0*/ q: B.() -> kotlin.Unit): B
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ public final class B {
|
||||
public constructor Pair</*0*/ out A, /*1*/ out B>(/*0*/ first: A, /*1*/ second: B)
|
||||
public final val first: A
|
||||
public final val second: B
|
||||
public final /*synthesized*/ fun component1(): A
|
||||
public final /*synthesized*/ fun component2(): B
|
||||
public final operator /*synthesized*/ fun component1(): A
|
||||
public final operator /*synthesized*/ fun component2(): B
|
||||
public final /*synthesized*/ fun copy(/*0*/ first: A = ..., /*1*/ second: B = ...): Pair<A, B>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
+5
-5
@@ -1,15 +1,15 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class C {
|
||||
fun get(i: Int): C = this
|
||||
operator fun get(i: Int): C = this
|
||||
}
|
||||
|
||||
fun C.plus(a: Any): C = this
|
||||
fun C.plusAssign(a: Any) {}
|
||||
operator fun C.plus(a: Any): C = this
|
||||
operator fun C.plusAssign(a: Any) {}
|
||||
|
||||
class C1 {
|
||||
fun get(i: Int): C = C()
|
||||
fun set(i: Int, v: C) {}
|
||||
operator fun get(i: Int): C = C()
|
||||
operator fun set(i: Int, v: C) {}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
|
||||
+5
-5
@@ -1,13 +1,13 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
public fun C.plus(/*0*/ a: kotlin.Any): C
|
||||
public fun C.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit
|
||||
public operator fun C.plus(/*0*/ a: kotlin.Any): C
|
||||
public operator fun C.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit
|
||||
|
||||
public final class C {
|
||||
public constructor C()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun get(/*0*/ i: kotlin.Int): C
|
||||
public final operator fun get(/*0*/ i: kotlin.Int): C
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -15,8 +15,8 @@ public final class C {
|
||||
public final class C1 {
|
||||
public constructor C1()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun get(/*0*/ i: kotlin.Int): C
|
||||
public final operator fun get(/*0*/ i: kotlin.Int): C
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun set(/*0*/ i: kotlin.Int, /*1*/ v: C): kotlin.Unit
|
||||
public final operator fun set(/*0*/ i: kotlin.Int, /*1*/ v: C): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
|
||||
class C
|
||||
|
||||
fun C.plus(a: Any): C = this
|
||||
fun C.plusAssign(a: Any) {}
|
||||
operator fun C.plus(a: Any): C = this
|
||||
operator fun C.plusAssign(a: Any) {}
|
||||
|
||||
fun test() {
|
||||
val c = C()
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
public fun C.plus(/*0*/ a: kotlin.Any): C
|
||||
public fun C.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit
|
||||
public operator fun C.plus(/*0*/ a: kotlin.Any): C
|
||||
public operator fun C.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit
|
||||
|
||||
public final class C {
|
||||
public constructor C()
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@ class C {
|
||||
val c: C = C()
|
||||
}
|
||||
|
||||
fun C.plus(a: Any): C = this
|
||||
fun C.plusAssign(a: Any) {}
|
||||
operator fun C.plus(a: Any): C = this
|
||||
operator fun C.plusAssign(a: Any) {}
|
||||
|
||||
class C1 {
|
||||
var c: C = C()
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package
|
||||
|
||||
public fun test(): kotlin.Unit
|
||||
public fun C.plus(/*0*/ a: kotlin.Any): C
|
||||
public fun C.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit
|
||||
public operator fun C.plus(/*0*/ a: kotlin.Any): C
|
||||
public operator fun C.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit
|
||||
|
||||
public final class C {
|
||||
public constructor C()
|
||||
|
||||
Reference in New Issue
Block a user