-
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
Unsafe type Inference with spread #60878
Comments
Note: not a TS team member. Duplicate #60623, #50559, #10727. The title and search terms do not adequately summarize or reflect the issue you're facing. If this were not a duplicate, I'd suggest you edit to address it. |
sorry, I'm not good at englishπ₯² In this manner, if it becomes |
But it's not optional, it's always provided. Optional has different semantics (defined or not defined), which matters with |
oh my mistake. |
When TypeScript uses the spread operator, excess property checks can be unintentionally disabled, resulting in unsafe type inference. |
π Search Terms
unsafe type with spread
,spread
,optional type
,type inference
π Version & Regression Information
I think all versions
β― Playground Link
https://www.typescriptlang.org/play/?#code/MYGwhgzhAECCBCBhaBvAUNaBLAJgLmggBcAnLAOwHMBuDaMA4sq2u4Ae3KYFdgj2SACjAlKEAinqNSFStAC+ASlR1MRABZYIAOlzQAvNABEARiO1MazTrAH6omxYVo6AdywbhDifQD805jklFUtoDi4iegAjYDtyAFNXOCRBdFDMbUyNLQAaVUsGezFtMDzQpSdMMBjdHDtsnVxK6BJ4om4ScmjgJ3k0PrRw4m64xOTEVIYAcnV4kBB2aFcBEBwppUHOCHYQeO0FykEjVohuECI8Ixzu7XdPFCUSxSA
π» Code
π Actual behavior
when I use
with
method without arguements like belownewAbc.a is undefined.
constructor want
a is required
but with give constructor undefined.I think it's not expected working.
π Expected behavior
It should be caught by compiler. because It's not developer expected working!
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: