"Inapplicable operator modifier" and "Inapplicable infix modifier" are now errors
This commit is contained in:
-12
@@ -1,12 +0,0 @@
|
||||
var result = "Fail"
|
||||
|
||||
class A
|
||||
|
||||
operator fun A.plusAssign(a: A, s: String = "OK") {
|
||||
result = s
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
A() += A()
|
||||
return result
|
||||
}
|
||||
Vendored
-14
@@ -1,14 +0,0 @@
|
||||
var result = "Fail"
|
||||
|
||||
class A
|
||||
|
||||
operator fun A.plus(a: A, s: String = "OK"): A {
|
||||
result = s
|
||||
return this
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var a = A()
|
||||
a += A()
|
||||
return result
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
infix fun Int.foo(o: String, k: String = "K") = o + k
|
||||
|
||||
fun box() = 42 foo "O"
|
||||
@@ -1,5 +0,0 @@
|
||||
class A
|
||||
|
||||
operator fun A.plus(i: A, ok: String = "OK") = ok
|
||||
|
||||
fun box() = A() + A()
|
||||
@@ -1,5 +0,0 @@
|
||||
class A
|
||||
|
||||
operator fun A.contains(i: A, actual: Boolean = true) = actual
|
||||
|
||||
fun box() = if (A() in A()) "OK" else "Fail"
|
||||
Reference in New Issue
Block a user