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
Needless to say, below code infferd as String Literal Types.
export const INCREMENT = "INCREMENT" export const SET_COUNT = "SET_COUNT" as "SET_COUNT"
// result of infer const INCREMENT: "INCREMENT" const SET_COUNT: "SET_COUNT"
When put them in the object, It is no longer as String Literal Types without assertion. Is it correct to be interpreted as weak inference?
const object = { INCREMENT, SET_COUNT }
// result of infer const object: { INCREMENT: string; SET_COUNT: "SET_COUNT"; }
And this problem can avoid below code.
const object = { INCREMENT: INCREMENT as (typeof INCREMENT), SET_COUNT }
// result of infer const object: { INCREMENT: "INCREMENT"; SET_COUNT: "SET_COUNT"; }
I am waiting for reply. Best reguards.
The text was updated successfully, but these errors were encountered:
I think the solution to this is covered by #10195
Sorry, something went wrong.
@jack-williams thanks! I'll track them.
umm...Is the pointer reference strength different depending on whether assertion is present or not?
See #11126 for a description of this behavior.
@ahejlsberg thanks for reply. I understood about Widening and non-widening. I'll write some localized post about them.
Widening and non-widening
No branches or pull requests
Needless to say, below code infferd as String Literal Types.
When put them in the object, It is no longer as String Literal Types without assertion.
Is it correct to be interpreted as weak inference?
And this problem can avoid below code.
I am waiting for reply. Best reguards.
The text was updated successfully, but these errors were encountered: