Files
kotlin-fork/js/js.translator/testData/box/reflection/_common.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

38 lines
556 B
Kotlin
Vendored

package foo
open class A
class B : A() {
val a = 1
}
object O
interface I
enum class E {
X,
Y {
val a = 1
},
Z {}
}
@JsName("Q")
class R
fun check(x: Any, y: Any, shouldBeEqual: Boolean = true, shouldBeSame: Boolean = true) {
assertNotEquals(null, x)
assertNotEquals(null, y)
if (shouldBeEqual) {
assertEquals(x, y)
if (shouldBeSame && x !== y) {
fail("Expected same instances, got expected = '$x', actual = '$y'")
}
}
else {
assertNotEquals(x, y)
}
}