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

The spec doesn't describe the newest cast semantics #12419

Closed
dimvar opened this issue Nov 21, 2016 · 1 comment
Closed

The spec doesn't describe the newest cast semantics #12419

dimvar opened this issue Nov 21, 2016 · 1 comment
Assignees
Labels
Spec Issues related to the TypeScript language specification

Comments

@dimvar
Copy link

dimvar commented Nov 21, 2016

When casting from a type A to a type B, the spec says that either A is assignable to B, or B is assignable to A. But the playground allows something more general: in some cases, as long as A and B have a common subtype, it doesn’t warn. The next example is valid.

function f(x: number | string) {
    return <number | boolean>(x);
}

The playground uses the comparable relation. The spec should be updated to include it.

@RyanCavanaugh RyanCavanaugh added Help Wanted You can do this Spec Issues related to the TypeScript language specification Bug A bug in TypeScript and removed Help Wanted You can do this labels Nov 21, 2016
@DanielRosenwasser DanielRosenwasser self-assigned this Nov 22, 2016
@mhegazy mhegazy removed the Bug A bug in TypeScript label Dec 7, 2016
@RyanCavanaugh
Copy link
Member

The spec is now an "archived" artifact and we won't be tracking defects against it anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Spec Issues related to the TypeScript language specification
Projects
None yet
Development

No branches or pull requests

4 participants