[KJS] Throw exception on recursive types provided to typeOf and provide proper support later within KT-40173
#KT-38140 fixed
This commit is contained in:
compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/recursiveBoundWithInline.kt
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi
|
||||
// TODO: it should target all backends, but now it's possible to have only one .fial file per test file,
|
||||
// so we can't define different messages for different test suites/runners.
|
||||
// TARGET_BACKEND: JS
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
|
||||
import kotlin.reflect.typeOf
|
||||
|
||||
fun <T : Comparable<T>> foo() {
|
||||
bar<List<T>>()
|
||||
baz<List<T>>()
|
||||
}
|
||||
|
||||
inline fun <reified T> bar() {
|
||||
baz<T>()
|
||||
}
|
||||
|
||||
inline fun <reified T> baz() {
|
||||
typeOf<Set<T>>()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
foo<Int>()
|
||||
return "OK"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
An operation is not implemented: Non-reified type parameters with recursive bounds are not supported yet
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi
|
||||
// TODO: it should target all backends, but now it's possible to have only one .fial file per test file,
|
||||
// so we can't define different messages for different test suites/runners.
|
||||
// TARGET_BACKEND: JS
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
|
||||
import kotlin.reflect.typeOf
|
||||
|
||||
fun <T : Comparable<T>> foo() {
|
||||
typeOf<List<T>>()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
foo<Int>()
|
||||
return "OK"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
An operation is not implemented: Non-reified type parameters with recursive bounds are not supported yet
|
||||
Reference in New Issue
Block a user