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

Regenerated setter causes invalid override #310

Closed
Schahen opened this issue Jun 17, 2020 · 0 comments
Closed

Regenerated setter causes invalid override #310

Schahen opened this issue Jun 17, 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 Jun 17, 2020

Following code:

interface Dict<T> {
    [key: string]: T | undefined;
}

interface BasicHeaders extends Dict<string | string[]> {
    'retry-after'?: string;
    'set-cookie'?: string[];
}

export interface ExtendedHeaders extends BasicHeaders {
    ":path"?: string;
}

is translated to:

external interface Dict<T> {
    @nativeGetter
    operator fun get(key: String): T?
    @nativeSetter
    operator fun set(key: String, value: T?)
}

external interface BasicHeaders : Dict<dynamic /* String | Array<String> */> {
    override operator fun get(key: String): Any?
    override operator fun set(key: String, value: Any?)
}

external interface ExtendedHeaders : BasicHeaders {
    override operator fun get(key: String): String?
    override operator fun set(key: String, value: String?)
}

which actually will fail to compile:

out/index.module_tmp.kt:32:5: error: 'set' overrides nothing
    override operator fun set(key: String, value: String?)
    ^
@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 Jun 17, 2020
@Schahen Schahen added this to the 0.5.3 milestone Jun 17, 2020
Schahen added a commit that referenced this issue Jun 19, 2020
@Schahen Schahen closed this as completed Jun 19, 2020
@Schahen Schahen changed the title Regenerated setter causes fake override Regenerated setter causes invalid override Jun 20, 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