Fix tests: "infix modifier required" and "operator modifier required" errors

This commit is contained in:
Yan Zhulanow
2015-11-26 15:56:56 +03:00
parent a3ff3ffc45
commit 9d1af5a17e
635 changed files with 1283 additions and 1617 deletions
@@ -45,14 +45,14 @@ class Error(text : String) : Token("[Error: $text]")
fun tokenize(text : String) : Deque<Token> {
val result = LinkedList<Token>()
for (c in text) {
result add when (c) {
result.add(when (c) {
'(' -> LPAR
')' -> RPAR
'+' -> PLUS
'*' -> TIMES
in '0'..'9' -> Number(c.toString())
else -> Error(c.toString())
}
})
}
result.add(EOF)
return result
@@ -53,7 +53,7 @@ inline fun test(): String {
return "123"
}
fun String.fail(p: String): String {
infix fun String.fail(p: String): String {
throw AssertionError("fail")
}
@@ -8,7 +8,7 @@ fun box(): String {
}
}
catch (caught: Throwable) {
if (!(caught identityEquals e)) return "Fail: $caught"
if (!(caught.identityEquals(e))) return "Fail: $caught"
}
return "OK"
@@ -8,7 +8,7 @@ fun box(): String {
}
}
catch (caught: Throwable) {
if (!(caught identityEquals e)) return "Fail: $caught"
if (!(caught.identityEquals(e))) return "Fail: $caught"
// If monitorexit didn't happen (a finally block failed), this assertion would fail
assertThatThreadDoesNotOwnMonitor(obj)
}