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

Rudiment type params lead to conflicting overloads #301

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

Rudiment type params lead to conflicting overloads #301

Schahen opened this issue Jun 5, 2020 · 0 comments
Labels
better-translation Code is translated and even useable, but can be better ir-target causes problems with IR compilation
Milestone

Comments

@Schahen
Copy link
Contributor

Schahen commented Jun 5, 2020

Following code:

interface MyPromiseLike<T>{}
interface MyPromise<T>{}

interface MyPromiseConstructor {
  all<T1, T2>(values: [T1 | MyPromiseLike<T1>, T2 | MyPromiseLike<T2>]): MyPromise<[T1, T2]>;
  all<T1, T2, T3>(values: [T1 | MyPromiseLike<T1>, T2 | MyPromiseLike<T2>, T3 | MyPromiseLike<T3>]): MyPromise<[T1, T2, T3]>;
}

will be translated to:

@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS", "EXTERNAL_DELEGATION")

external interface MyPromiseLike<T>
external interface MyPromise<T>

external interface MyPromiseConstructor {
    fun <T1, T2> all(values: dynamic /* JsTuple<dynamic, dynamic> */): MyPromise<dynamic /* JsTuple<T1, T2> */>
    fun <T1, T2, T3> all(values: dynamic /* JsTuple<dynamic, dynamic, dynamic> */): MyPromise<dynamic /* JsTuple<T1, T2, T3> */>
}

Which compiles only because of @file:Suppress("CONFLICTING_OVERLOADS") - actually because type params are note invoked both all are identical.

@Schahen Schahen added ir-target causes problems with IR compilation better-translation Code is translated and even useable, but can be better labels Jun 5, 2020
@Schahen Schahen added this to the 0.5.2 milestone Jun 5, 2020
@Schahen Schahen changed the title Rudiment type params lead to conf Rudiment type params lead to conflicting overloads Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
better-translation Code is translated and even useable, but can be better ir-target causes problems with IR compilation
Projects
None yet
Development

No branches or pull requests

1 participant