is an unsafeCast still subject to classcast except...
# javascript
b
is an unsafeCast still subject to classcast exceptions?
1
t
Do you have code example?
b
no, just trying to figure out when those happen
they're very tricky to debug because I'm lacking stacktraces
my gutt feeling is that X as Y produces one but nothing else
I'm also running into some difficulties with class instance checks since a super class is not accessible to Kotlin during runtime
well technically it is, but it's a proxy hack by another dev to work around limitations
so I can instanceof Weapon for instance, but not Item
(constructor returns a different instance based on the .type field)
e
Nope,
unsafeCast<T>
will just take
T
as granted. No transformation is done in the compiled JS
b
thank you