``` /* generated by dukat */ external open class A...
# javascript
u
Copy code
/* generated by dukat */ external open class A {
    open fun foo()
    open fun foo(p: Int)
}

/* abstract or */ open class B : A() // <--- OK. No errors

class C : B() // <--- Error: JavaScript name foo is generated for different inherited members: fun foo(): Unit and fun foo(p: Int): Unit
What's wrong?
u
Three things to consider here actually - one problem is that IDE is not showing you that this won't compile (will fix), the other that we need to revisit this issue and to think again whether this behavior is something we should have at all. Last but not least - regarding what's said above it's a translation bug in dukat which I'll create an issue about and it'll be fixed. as a workaround, you can fix it by:
Copy code
external open class A {
    open fun foo(p: Int = definedExternally)
}
u
@[JB] Shagen IDE gives me same result as compiler.
class B : A()
compiles well. And everything worked without problems until I tried to add
class C
@[JB] Shagen I show a simplified version. In fact, I have a method overloaded with a large number of variants (and not all of them can be just replaced with optional parameters).
@[JB] Shagen As workaround I use:
Copy code
external open class A {
         fun foo()
    open fun foo(p: Int)
}
I found that if only one method is marked with the modifier
open
then everything is ok. Although I still don’t understand why
class B: A ()
works without workaround.
🤦 1
b
@U75957 please file an issue with link to this thread.
compiler shouldn’t report any error until you try to override such declaration (with overloads).
u