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

[TS] Add support for "type cast and assign" #7175

Closed
nicolo-ribaudo opened this Issue Jan 8, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@nicolo-ribaudo
Member

nicolo-ribaudo commented Jan 8, 2018

(<number> foo) = 0;

#7098 can be used as an example of what needs to be done.

@joaomcarvalho

This comment has been minimized.

Show comment
Hide comment
@joaomcarvalho

joaomcarvalho Jan 10, 2018

Is that a good first issue @nicolo-ribaudo ? I would like to help. Do you think you can point me a starting point?

joaomcarvalho commented Jan 10, 2018

Is that a good first issue @nicolo-ribaudo ? I would like to help. Do you think you can point me a starting point?

@nicolo-ribaudo

This comment has been minimized.

Show comment
Hide comment
@nicolo-ribaudo

nicolo-ribaudo Jan 10, 2018

Member

Here are the parts of Babylon (Babel's parser) which check the left node of an assignment expression:

Since the typescript grammar is defined as an internal Babylon plugin, that methods shouldn't be modified directly, but it should be overwritten in https://github.com/babel/babel/blob/master/packages/babylon/src/plugins/typescript.js to work with TSTypeAssertion

#7098 fixes a bug very similar to this one, so I'd suggest looking at that PR!

If you need any additional help, feel free to contact me on slack

Member

nicolo-ribaudo commented Jan 10, 2018

Here are the parts of Babylon (Babel's parser) which check the left node of an assignment expression:

Since the typescript grammar is defined as an internal Babylon plugin, that methods shouldn't be modified directly, but it should be overwritten in https://github.com/babel/babel/blob/master/packages/babylon/src/plugins/typescript.js to work with TSTypeAssertion

#7098 fixes a bug very similar to this one, so I'd suggest looking at that PR!

If you need any additional help, feel free to contact me on slack

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.