Fix compiler tests
This commit is contained in:
Vendored
+2
-2
@@ -24,7 +24,7 @@ import java.util.*
|
||||
}
|
||||
|
||||
abstract class TagWithText(name : String) : Tag(name) {
|
||||
fun String.plus() {
|
||||
operator fun String.plus() {
|
||||
children.add(TextElement(this))
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ import java.util.*
|
||||
}
|
||||
}
|
||||
|
||||
fun MutableMap<String, String>.set(key : String, value : String) = this.put(key, value)
|
||||
operator fun MutableMap<String, String>.set(key : String, value : String) = this.put(key, value)
|
||||
|
||||
fun html(init : HTML.() -> Unit) : HTML {
|
||||
val html = HTML()
|
||||
|
||||
+3
-3
@@ -13,7 +13,7 @@ fun <T: Any, E> T.foo(<warning>x</warning> : E, y : A) : T {
|
||||
|
||||
class A
|
||||
|
||||
fun A.plus(<warning>a</warning> : Any) {
|
||||
operator fun A.plus(<warning>a</warning> : Any) {
|
||||
|
||||
1.foo()
|
||||
true.<error>foo</error>(<error><error>)</error></error>
|
||||
@@ -21,7 +21,7 @@ fun A.plus(<warning>a</warning> : Any) {
|
||||
<warning>1</warning>
|
||||
}
|
||||
|
||||
fun A.plus(<warning>a</warning> : Int) {
|
||||
operator fun A.plus(<warning>a</warning> : Int) {
|
||||
<warning>1</warning>
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ fun Int.foo() = this
|
||||
val foo : Int = 0
|
||||
}
|
||||
|
||||
fun Any.equals(<warning>other</warning> : Any?) : Boolean = true
|
||||
operator fun Any.equals(<warning>other</warning> : Any?) : Boolean = true
|
||||
fun Any?.equals1(<warning>other</warning> : Any?) : Boolean = true
|
||||
fun Any.equals2(<warning>other</warning> : Any?) : Boolean = true
|
||||
|
||||
|
||||
+17
-17
@@ -7,64 +7,64 @@ class NotRange1() {
|
||||
}
|
||||
|
||||
abstract class NotRange2() {
|
||||
abstract fun iterator() : Unit
|
||||
abstract operator fun iterator() : Unit
|
||||
}
|
||||
|
||||
abstract class ImproperIterator1 {
|
||||
abstract fun hasNext() : Boolean
|
||||
abstract operator fun hasNext() : Boolean
|
||||
}
|
||||
|
||||
abstract class NotRange3() {
|
||||
abstract fun iterator() : ImproperIterator1
|
||||
abstract operator fun iterator() : ImproperIterator1
|
||||
}
|
||||
|
||||
abstract class ImproperIterator2 {
|
||||
abstract fun next() : Boolean
|
||||
abstract operator fun next() : Boolean
|
||||
}
|
||||
|
||||
abstract class NotRange4() {
|
||||
abstract fun iterator() : ImproperIterator2
|
||||
abstract operator fun iterator() : ImproperIterator2
|
||||
}
|
||||
|
||||
abstract class ImproperIterator3 {
|
||||
abstract fun hasNext() : Int
|
||||
abstract fun next() : Int
|
||||
abstract operator fun hasNext() : Int
|
||||
abstract operator fun next() : Int
|
||||
}
|
||||
|
||||
abstract class NotRange5() {
|
||||
abstract fun iterator() : ImproperIterator3
|
||||
abstract operator fun iterator() : ImproperIterator3
|
||||
}
|
||||
|
||||
abstract class AmbiguousHasNextIterator {
|
||||
abstract fun hasNext() : Boolean
|
||||
abstract operator fun hasNext() : Boolean
|
||||
val hasNext : Boolean get() = false
|
||||
abstract fun next() : Int
|
||||
abstract operator fun next() : Int
|
||||
}
|
||||
|
||||
abstract class NotRange6() {
|
||||
abstract fun iterator() : AmbiguousHasNextIterator
|
||||
abstract operator fun iterator() : AmbiguousHasNextIterator
|
||||
}
|
||||
|
||||
abstract class ImproperIterator4 {
|
||||
val hasNext : Int get() = 1
|
||||
abstract fun next() : Int
|
||||
abstract operator fun next() : Int
|
||||
}
|
||||
|
||||
abstract class NotRange7() {
|
||||
abstract fun iterator() : ImproperIterator3
|
||||
abstract operator fun iterator() : ImproperIterator3
|
||||
}
|
||||
|
||||
abstract class GoodIterator {
|
||||
abstract fun hasNext() : Boolean
|
||||
abstract fun next() : Int
|
||||
abstract operator fun hasNext() : Boolean
|
||||
abstract operator fun next() : Int
|
||||
}
|
||||
|
||||
abstract class Range0() {
|
||||
abstract fun iterator() : GoodIterator
|
||||
abstract operator fun iterator() : GoodIterator
|
||||
}
|
||||
|
||||
abstract class Range1() {
|
||||
abstract fun iterator() : Iterator<Int>
|
||||
abstract operator fun iterator() : Iterator<Int>
|
||||
}
|
||||
|
||||
fun test(notRange1: NotRange1, notRange2: NotRange2, notRange3: NotRange3, notRange4: NotRange4, notRange5: NotRange5, notRange6: NotRange6, notRange7: NotRange7, range0: Range0, range1: Range1) {
|
||||
|
||||
Vendored
+6
-6
@@ -1,6 +1,6 @@
|
||||
class IncDec() {
|
||||
fun inc() : IncDec = this
|
||||
fun dec() : IncDec = this
|
||||
operator fun inc() : IncDec = this
|
||||
operator fun dec() : IncDec = this
|
||||
}
|
||||
|
||||
fun testIncDec() {
|
||||
@@ -16,8 +16,8 @@ fun testIncDec() {
|
||||
}
|
||||
|
||||
class WrongIncDec() {
|
||||
fun inc() : Int = 1
|
||||
fun dec() : Int = 1
|
||||
operator fun inc() : Int = 1
|
||||
operator fun dec() : Int = 1
|
||||
}
|
||||
|
||||
fun testWrongIncDec() {
|
||||
@@ -29,8 +29,8 @@ fun testWrongIncDec() {
|
||||
}
|
||||
|
||||
class UnitIncDec() {
|
||||
fun inc() : Unit {}
|
||||
fun dec() : Unit {}
|
||||
operator fun inc() : Unit {}
|
||||
operator fun dec() : Unit {}
|
||||
}
|
||||
|
||||
fun testUnitIncDec() {
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
class A {
|
||||
fun component1() = 42
|
||||
fun component2() = 42
|
||||
operator fun component1() = 42
|
||||
operator fun component2() = 42
|
||||
}
|
||||
|
||||
fun arrayA(): Array<A> = null!!
|
||||
|
||||
Reference in New Issue
Block a user