JS: prohibit passing native interfaces to reified type parameters

This commit is contained in:
Alexey Andreev
2016-09-30 14:54:50 +03:00
parent acf7fcaebf
commit 2eb54f234c
10 changed files with 124 additions and 1 deletions
@@ -0,0 +1,25 @@
//FILE: nativeClassAsReifiedTypeArgument.kt
var global = ""
inline fun <reified T> log(x: T) {
global += jsClass<T>().name + ": " + x
}
@native class C {
override fun toString() = noImpl
}
fun box(): String {
log(C())
if (global != "C: C instance") return "fail: $global"
return "OK"
}
//FILE: nativeClassAsReifiedTypeArgument.js
function C() {
}
C.prototype.toString = function() {
return "C instance"
}