Files
kotlin-fork/js/js.translator/testData/box/reflection/jsClass.kt
T
Zalim Bashorov 3c520a3ce3 JS backend: basic support for class literals.
Added:
* the ability to get KClass using class literals (`::class`);
* the ability to get KClass from JsClass and vice versa;
* the ability to get simpleName.

 #KT-13345 Fixed
2016-10-14 19:44:53 +03:00

15 lines
379 B
Kotlin
Vendored

package foo
fun box(): String {
check(jsClass<A>(), A().jsClass)
check(jsClass<B>(), B().jsClass)
check(jsClass<O>(), O.jsClass)
assertNotEquals(null, jsClass<I>())
check(jsClass<E>(), E.X.jsClass)
check(jsClass<E>(), E.Y.jsClass, shouldBeEqual = false)
// TODO uncomment after KT-13338 is fixed
// check(jsClass<E>(), E.Z.jsClass)
return "OK"
}