You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior:
No errors. And TypeScript 2.6.2 properly handles this case.
If I change the last line to const a: WithLoading = { loading: loading }; then there won't be any error, so it looks definitely like a bug.
Actual behavior:
Types of property 'loading' are incompatible. Type 'boolean' is not assignable to type 'false'.
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.7.1
Code
Expected behavior:
No errors. And TypeScript 2.6.2 properly handles this case.
If I change the last line to
const a: WithLoading = { loading: loading };
then there won't be any error, so it looks definitely like a bug.Actual behavior:
Types of property 'loading' are incompatible. Type 'boolean' is not assignable to type 'false'.
Playground Link:
https://www.typescriptlang.org/play/index.html#src=type%20WithLoading%20%3D%20%7B%20loading%3A%20true%3B%20%7D%20%7C%20%7B%20loading%3A%20false%3B%20%7D%3B%0A%0Aconst%20loading%20%3D%20true%3B%0A%0Aconst%20a%3A%20WithLoading%20%3D%20%7B%20loading%20%7D%3B
The text was updated successfully, but these errors were encountered: