It is so frustating when I face an issue I can't r...
# random
a
It is so frustating when I face an issue I can't report because I can't reproduce it 😞
😞 1
l
What kind of issue is it?
a
It is a JSIR issue, I have interfaces marked with
@JsExport
like
Copy code
interface Animal {
  fun makeSound(): String
}
An then I have implementations like
Copy code
class DomesticAnimal : Animal()

class WildAnimal : Animal()
I have objects that expose these interfaces like
Copy code
@file:JsExport
class Farm(val animals: Array<Animal>)

fun makeFarm():Farm {
  // . . . 
}
All of this is bundle into a javascript library to be consumed by the frontend devs Problem
Copy code
import SDK from 'lib'

const farm = SDK.makeFarm() // returns a Farm object even types from .d.ts are resolved

const animals = farm.animals // returns an array of mangled Animal objects.
At this point the properties of the contents of the array are mangled. The funny thing is, in this toy example, I failed to reproduce this, no object was mangled, but in our very large application, they appear to be mangled. I tried exporting and not exporting implementations. This did not make any difference in the reproducer all objects came out unmagled, but in our large application they are still mangled even when the classes are exported or not. In short exporting doesn't even make a difference there as well. Wish I wish that I could just export the interfaces and don't really care about the implementation details, this seems to be possible in my reproducer but it seems like it is not consistent, Hence I can't even report it well
l
Can you show the mangled symbol?
a
l
Great, will be helpful for kotl.in/issue