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

Method copied to interface implementation preserving type params #280

Closed
Schahen opened this issue May 6, 2020 · 0 comments
Closed

Method copied to interface implementation preserving type params #280

Schahen opened this issue May 6, 2020 · 0 comments
Labels
compilation-failure kotlin code is generated but this code fails to be compiled

Comments

@Schahen
Copy link
Contributor

Schahen commented May 6, 2020

Following code:

interface StatsBase<T> {
  ping(o: T);
  pong(): T;
  uid: T,
}

interface Stats  extends StatsBase<number> {}
declare class Stats {}

is translated to:

external interface StatsBase<T> {
    fun ping(o: T)
    fun pong(): T
    var uid: T
}

external open class Stats : StatsBase<Number> {
    override fun ping(o: T)
    override fun pong(): T
    override var uid: T
}

While, of course actually we want to have

external open class Stats : StatsBase<Number> {
    override fun ping(o: Number)
    override fun pong(): Number
    override var uid: Number
}
@Schahen Schahen added the compilation-failure kotlin code is generated but this code fails to be compiled label May 6, 2020
@Schahen Schahen closed this as completed in ec65a21 May 6, 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

1 participant