Fix tests: "infix modifier required" and "operator modifier required" errors
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user