-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
5.3.0 regression - as const
is being ignored in assignment, leading to false negatives
#56128
Comments
@Andarist finding the PR faster than the bisect script I had going ππ’! While not identical to the issue in the linked PR, the case for this one being an error also seems a bit weak to me. You still get the desired error in the aliased case (good): const arr = [42] as const;
let x: Array<number> = arr; whereas erroring that the provably-only reference of a mutable array is an array you annotated with Aaaaaand I just saw you closed this. Cool π₯° |
I have all Anders' PRs on my speed dial π€£ |
π Search Terms
"as const", 5.3.0, assignment
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?ts=5.3.0-dev.20231016#code/PTAEAEBcGcFoFMAeAHeBjSCBOWD2XQAVACwEtpRpjcBXAGwBNQAjeUAQ1EgE9VR4c+FunY1obAAZZ47BrgB2dbqADaAFgBMAXQmhyoebkgdo0UgHN57ZnTaRcoCQEEc7bgB55NALassAPgkAKFtjRAAuUBcsN08fP39QAF5VTS0TUDQFaEgAbiCgA
π» Code
π Actual behavior
No type error
π Expected behavior
Type error
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: