https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
a

andylamax

12/26/2020, 7:41 PM
Hi, I am having scenerios where I get
NoSuchMethod
in jvm runtime. It is multiplatform code that executes well in kotlin/js browser, but fails in jvm implementation looks something like this // in submodule
common
Copy code
interface ICommon 

fun ICommon.greet(greeting: String, name: String)
// in submodule
client
which depends on common
Copy code
interface IClient : ICommon

class ClientImpl(): IClient
// my tests in submodule
client
class
Copy code
ClientImpl().greet("Hello","World");
Passes on js/browser, fails on jvm using IR for both JVM and JS
Strange thing. So I did the following instead of
ClientImpl().greet("Hello","World")
, I wrote
(ClientImpl() as ICommon).greet("Hello","World")
Compiled and it worked. I then got rid of the casting, and it still works
c

cy

12/27/2020, 6:47 AM
Looks like a bug. I would file a ticket . IR backends are not stable yet so it's not that strange
a

andylamax

12/27/2020, 10:04 AM
Can I even file a bug that is flaky to reproduce? Same way it was flaky on my machine?
3 Views