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

Conflicting override while merging class and interface extending eponymous namespaces interface #330

Closed
Schahen opened this issue Jul 15, 2020 · 0 comments
Labels
compilation-failure kotlin code is generated but this code fails to be compiled domain:override missing overrides, redundant overrides, duplicate overrides etc.
Milestone

Comments

@Schahen
Copy link
Contributor

Schahen commented Jul 15, 2020

Following code:

// _api.d.ts
declare namespace API {
  interface Module {
    children: Module[];
  }
}

interface ApiModule extends API.Module {}

/// <reference path="./_api.d.ts" />

// index.d.ts
declare module "mymodule" {
  interface Module extends ApiModule {}
  class Module {
    children: API.Module[];
  }
}

Leads to creating (among other things) of following declaration:

external open class Module : ApiModule {
    override var children: Array<Module>
    override var children: Array<API.Module>
}

The introduction of first children is obviously a bug and, of course, this leads to a compilation errors:

a/aaa.mymodule.kt:23:18: error: conflicting declarations: public open var children: Array<mymodule.Module>, public open var children: Array<API.Module>
    override var children: Array<Module>
                 ^
a/aaa.mymodule.kt:23:28: error: type of 'children' doesn't match the type of the overridden var-property 'public abstract var children: Array<API.Module> defined in ApiModule'
    override var children: Array<Module>
                           ^
a/aaa.mymodule.kt:24:18: error: conflicting declarations: public open var children: Array<mymodule.Module>, public open var children: Array<API.Module>
    override var children: Array<API.Module>
@Schahen Schahen added compilation-failure kotlin code is generated but this code fails to be compiled domain:override missing overrides, redundant overrides, duplicate overrides etc. labels Jul 15, 2020
@Schahen Schahen added this to the 0.5.7 milestone Jul 15, 2020
@Schahen Schahen closed this as completed Jul 21, 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 domain:override missing overrides, redundant overrides, duplicate overrides etc.
Projects
None yet
Development

No branches or pull requests

1 participant