[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:
Zalim Bashorov
2020-07-10 02:45:30 +03:00
parent c552933459
commit 340512e27a
11 changed files with 108 additions and 21 deletions
@@ -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"
}
@@ -0,0 +1 @@
An operation is not implemented: Non-reified type parameters with recursive bounds are not supported yet
@@ -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"
}
@@ -0,0 +1 @@
An operation is not implemented: Non-reified type parameters with recursive bounds are not supported yet