Skip to content
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 '-=' subtraction assignment operator not supported #4109

Open
matthewtebbs opened this issue Apr 12, 2018 · 2 comments
Open

TypeScript '-=' subtraction assignment operator not supported #4109

matthewtebbs opened this issue Apr 12, 2018 · 2 comments

Comments

@matthewtebbs
Copy link
Contributor

matthewtebbs commented Apr 12, 2018

(really an improvement more than a bug)

When code is decompiled back to blocks by the emitter the '-=' operator is not supported,
e.g.

material.roughness -= myroughness

becomes,

image

Similarly using a negative operand with the '+=' operator we get an interesting round-trip,

material.roughness += -myroughness

becomes,

image

and then when switching back to code,

material.roughness += 0 - myroughness

If we introduced a negative block that would return negated numerical input we could special case this block in conjunction with the change block as its parent to compile/decompile to/from the '-=' operator and its associated expression.

@riknoll riknoll self-assigned this Apr 13, 2018
@riknoll
Copy link
Member

riknoll commented Apr 13, 2018

I guess I missed that operator. We should indeed discuss having a negation block, but that's a separate issue from this. I'll add support to -= with our existing 0 - x decompilation hack

@matthewtebbs
Copy link
Contributor Author

Added issue #4131 re: negation block that would represent a decompile from the unary negation operator ('-').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants