[TEST] Add test checking cast to DNN type

muted temporary due to required support in backends
This commit is contained in:
Roman Artemev
2021-10-28 12:47:00 +03:00
committed by TeamCityServer
parent 5b19c41373
commit 23ad0e7c63
9 changed files with 61 additions and 0 deletions
@@ -0,0 +1,17 @@
// !LANGUAGE: +DefinitelyNonNullableTypes
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND_FIR: JVM_IR
fun <T> test(t: T) = t as (T & Any)
fun box(): String {
try {
test<Any?>(null)
} catch (ex: NullPointerException) {
return "FAIL: expected NPE"
}
return test("OK")
}