We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 Version: 3.2.0-dev.201xxxxx
Search Terms: type narrowing tuple type inference tuple
Code
const x: [number, number] = [0, 0]; if (x[0] === 0) { x[0] = -1; }
Expected behavior: The code should compile. The above code does compile with typescript@3.0.3.
typescript@3.0.3
Actual behavior:
error TS2322: Type '-1' is not assignable to type '0'.
Playground Link: http://www.typescriptlang.org/play/
Related Issues:
The text was updated successfully, but these errors were encountered:
Duplicate of #27412.
Sorry, something went wrong.
Elt access assignment uses declared, not narrowed type
f5190d1
I forgot to do this in #26424. Fixes #27557 Fixes #27412
Elt access assignment uses declared, not narrowed type (#27574)
c080324
No branches or pull requests
TypeScript Version: 3.2.0-dev.201xxxxx
Search Terms:
type narrowing tuple
type inference tuple
Code
Expected behavior:
The code should compile. The above code does compile with
typescript@3.0.3
.Actual behavior:
error TS2322: Type '-1' is not assignable to type '0'.
Playground Link: http://www.typescriptlang.org/play/
Related Issues:
The text was updated successfully, but these errors were encountered: