dukat
dukat copied to clipboard
Name clash not resolved when conflicting entity is nested in a class
Consider the following type declarations:
declare namespace A {
class Foo {}
class Bar {}
namespace Bar {
class Foo extends A.Foo {}
}
}
We have a name clash here between the two Foo
classes - the one declared directly in namespace A and the other nested in a Bar
class.
Dukat v0.5.0 outputs the following Kotlin code (I omit imports and file annotations here):
package A
external open class Foo
external open class Bar {
open class Foo : Foo
}
This code does not compile because of a looped inheritance hierarchy. I expect the Bar
class to look like this instead:
external open class Bar {
open class Foo : A.Foo
}
I found this issue when converting TypeScript declarations for Google Maps JS API (https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/googlemaps/reference). There is a MouseEvent interface defined in google.maps
namespace there and another one MouseEvent interface defined in google.maps.events
that inherits from the first one. The resulting generated Kotlin code contains the same inheritance hierarchy loop for this interface.
looks related to https://github.com/Kotlin/dukat/issues/296