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
TypeScript Version: 2.0
Code
interface Foo { bar?: 'baz' | 'boz' } function x(params: Foo) { // doesn't work const { bar = 'baz' } = params } function y(params: Foo) { // works const { bar = 'baz' as 'baz' } = params }
Expected behavior: To compile
Actual behavior: error TS2322: Type 'string' is not assignable to type '"baz" | "boz"'. Type 'string' is not assignable to type '"boz"'.
error TS2322: Type 'string' is not assignable to type '"baz" | "boz"'. Type 'string' is not assignable to type '"boz"'.
The text was updated successfully, but these errors were encountered:
This should be working as expected in latest.
Sorry, something went wrong.
sandersn
No branches or pull requests
TypeScript Version: 2.0
Code
Expected behavior:
To compile
Actual behavior:
error TS2322: Type 'string' is not assignable to type '"baz" | "boz"'. Type 'string' is not assignable to type '"boz"'.
The text was updated successfully, but these errors were encountered: