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

Type parameters are not handled correctly when unaliasing #358

Closed
trilis opened this issue Aug 11, 2020 · 0 comments
Closed

Type parameters are not handled correctly when unaliasing #358

trilis opened this issue Aug 11, 2020 · 0 comments
Assignees
Labels
ir-target causes problems with IR compilation
Milestone

Comments

@trilis
Copy link
Contributor

trilis commented Aug 11, 2020

type ErrorHook<O, E> = (error: E, options: O) => void
type AfterHook<O, R> = (result: R, options: O) => void
type AnyHook<O, R, E> =
    | ErrorHook<O, E>
    | AfterHook<O, R>

export interface HookCollection {
    remove(name: string, hook: AnyHook<any, any, any>): void
}

generates:

typealias ErrorHook<O, E> = (error: E, options: O) -> Unit

typealias AfterHook<O, R> = (result: R, options: O) -> Unit

external interface HookCollection {
    fun remove(name: String, hook: ErrorHook<Any, Any>)
    fun remove(name: String, hook: AfterHook<Any, Any>)
}

which results in CONFLICTING_OVERLOADS fail, because ErrorHook and AfterHook should be the same after unaliasing.

Source: https://youtrack.jetbrains.com/issue/KT-40711#focus=Comments-27-4330455.0-0

@trilis trilis self-assigned this Aug 11, 2020
@trilis trilis added the ir-target causes problems with IR compilation label Aug 11, 2020
@trilis trilis linked a pull request Aug 11, 2020 that will close this issue
@trilis trilis added this to the 0.5.9 milestone Aug 13, 2020
@trilis trilis closed this as completed Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ir-target causes problems with IR compilation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant