-
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
Typescript can't type regconize error #59114
Comments
There is no bug here. Additional properties are allowed to exist on objects, and See also the FAQ: https://github.com/microsoft/TypeScript/wiki/FAQ#indirect-excess-properties-are-ok |
I see, thank you for fast responding. Is there a way for me to strictly type for object type? @MartinJohns |
No, see #12936 |
Thank you! I was confusing a bit. Should I close the issue? |
This issue has been marked as "Working as Intended" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
π Search Terms
"Wrong array type"
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.2.2#code/FAAhGMHsDsGcBcQEt4FMC2sQF4QG1QwiBvQoogBwCdIATAV3HgH0laAuEAIjQQEYATAGYuAGjLkQANwCGVJDOgs2nHqn7CxE8gEd6i+CgCenQUPGTKNdJEMwACjQbgAkh2694ZrZYC+FogBdAG5gMKg4RAALRVoAG1QAQVpaFzRMABVIAGE5RFwZWCNocBAACgkUDFhOUktqOkZldwR5aABzUMtZeQNWFvg2zu0QPQNjTmh6dAAjVCouyQabO2hmBudmgH5OVqQOxbBfPECAsEIAShwAPhBiXzDgGOh4pJS06qzcqngyqswLkA
π» Code
π Actual behavior
items
as argument intohandleAddItemsToCart
function. Typescript doesn't show me that IpromotionProductId
is not a valid field in array item. If I changepromotion_product_id?: string;
to not nulablepromotion_product_id: string;
, typescript will show me that I'm passing wrong field.π Expected behavior
promotionProductId: promotionProductId
.The text was updated successfully, but these errors were encountered: