Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name clash not resolved when conflicting entity is nested in a class #303

Open
Kiryushin-Andrey opened this issue Jun 8, 2020 · 1 comment
Labels
compilation-failure kotlin code is generated but this code fails to be compiled
Milestone

Comments

@Kiryushin-Andrey
Copy link

Kiryushin-Andrey commented Jun 8, 2020

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.

@Kiryushin-Andrey Kiryushin-Andrey changed the title Name clash not resolved when nested namespace involved Name clash not resolved when nesting clashing entity in a class Jun 8, 2020
@Kiryushin-Andrey Kiryushin-Andrey changed the title Name clash not resolved when nesting clashing entity in a class Name clash not resolved when conflicting entity is nested in a class Jun 8, 2020
@Schahen Schahen added the compilation-failure kotlin code is generated but this code fails to be compiled label Jun 10, 2020
@Schahen
Copy link
Contributor

Schahen commented Jun 18, 2020

looks related to #296

Schahen added a commit that referenced this issue Jun 30, 2020
but always append PROJECT_DIR by default
see #303
@Schahen Schahen added this to the 0.5.8 milestone Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compilation-failure kotlin code is generated but this code fails to be compiled
Projects
None yet
Development

No branches or pull requests

2 participants