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

Imported generic type does not show parameters #416

Open
yogeshsajanikar opened this issue May 21, 2021 · 0 comments
Open

Imported generic type does not show parameters #416

yogeshsajanikar opened this issue May 21, 2021 · 0 comments

Comments

@yogeshsajanikar
Copy link

If a generic type is imported, it does not have parameters. This results in a compilation error.

For example, following typescript declaration will result in incorrect fsharp declaration.

module Compare {
export declare type OrderedComparator<T, U = T> = (lhs: T, rhs: U) => number;
}

module SortedArray {
    import {OrderedComparator} from './Compare'
}
module Compare =

    type OrderedComparator<'T> =
        OrderedComparator<'T, 'T>

    type [<AllowNullLiteral>] OrderedComparator<'T, 'U> =
        [<Emit "$0($1...)">] abstract Invoke: lhs: 'T * rhs: 'U -> float

module SortedArray =
    type OrderedComparator = __Compare.OrderedComparator

The correct type should be

type OrderedComparator<'T,'U> = Compare.OrderedComparator<'T,'U>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant