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

Explicitly add type annotations to exported constants in expr-library #283

Open
AnyhowStep opened this issue Mar 7, 2020 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@AnyhowStep
Copy link
Owner

Instead of,

export const concat = makeOperator1ToN<OperatorType.CONCAT, string, string>(
    OperatorType.CONCAT,
    tm.string(),
    TypeHint.STRING
);

Use this,

export const concat : Operator1ToN<string, string> = makeOperator1ToN<OperatorType.CONCAT, string, string>(
    OperatorType.CONCAT,
    tm.string(),
    TypeHint.STRING
);

We cannot rely on type inference. We need to explicitly add type annotations or AMD declaration emit will break.

Keep an eye on this,
microsoft/TypeScript#37267

@AnyhowStep AnyhowStep added the bug Something isn't working label Mar 7, 2020
@AnyhowStep AnyhowStep self-assigned this Mar 7, 2020
AnyhowStep added a commit that referenced this issue Mar 7, 2020
AnyhowStep added a commit that referenced this issue Mar 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant