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

TypeScript outputs incorrect definition files for _tag fields #118

Closed
gcanti opened this issue Jun 5, 2017 · 0 comments
Closed

TypeScript outputs incorrect definition files for _tag fields #118

gcanti opened this issue Jun 5, 2017 · 0 comments
Assignees
Milestone

Comments

@gcanti
Copy link
Owner

gcanti commented Jun 5, 2017

Example: Option.d.ts

export declare class None<A> implements FantasyMonad<URI, A>, FantasyFoldable<A>, FantasyTraversable<URI, A>, FantasyAlternative<URI, A>, FantasyExtend<URI, A> {
    static of: typeof of;
    static empty: typeof empty;
    static zero: typeof zero;
    static value: Option<any>;
    readonly _tag: string; // this should be 'None', not `string`
    readonly _A: A;
    readonly _URI: URI;
    private constructor();

    ...
}

Can be fixed by adding an explicit type annotation in the source

readonly _tag: 'None' = 'None'

Relevant microsoft/TypeScript#15881

@gcanti gcanti added this to the 0.3.1 milestone Jun 5, 2017
@gcanti gcanti self-assigned this Jun 5, 2017
@gcanti gcanti closed this as completed in e6f79d8 Jun 5, 2017
gcanti added a commit that referenced this issue Jun 5, 2017
add _tag type annotations, closes #118
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