Fix codegen box tests for language version 1.4
Since API version 1.4, NullPointerException is thrown for casts of null to any type instead of TypeCastException.
This commit is contained in:
+2
-2
@@ -16,14 +16,14 @@ fun box(): String {
|
||||
try {
|
||||
val i = JImpl().arrayOfNotNull()[0]
|
||||
return "Fail: should throw on get()"
|
||||
} catch (e: IllegalStateException) {}
|
||||
} catch (e: NullPointerException) {}
|
||||
|
||||
try {
|
||||
for (i in JImpl().arrayOfNotNull()) {
|
||||
return "Fail: should throw on get() in loop header"
|
||||
}
|
||||
}
|
||||
catch (e: IllegalStateException) {}
|
||||
catch (e: NullPointerException) {}
|
||||
return "OK"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user