"Inapplicable operator modifier" and "Inapplicable infix modifier" are now errors

This commit is contained in:
Yan Zhulanow
2015-12-25 18:35:02 +03:00
parent f560799bb7
commit 3fa506fd45
67 changed files with 56 additions and 347 deletions
@@ -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
}
@@ -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"