Skip to content

Fix temp local confusion in field assignment #1109

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

Merged
merged 2 commits into from
Feb 14, 2020
Merged

Fix temp local confusion in field assignment #1109

merged 2 commits into from
Feb 14, 2020

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Feb 14, 2020

This PR fixes an issue caused by indexes of potential temporary locals in the RHS of a field assignment not being blocked preemptively. Also reorders the arguments to makeReplace to adhere to execution order fwiw.

fixes #1095

@MaxGraey
Copy link
Member

Could you plz add also minimal reproduction example for prevent regression in future?

@dcodeIO
Copy link
Member Author

dcodeIO commented Feb 14, 2020

Yeah, was once again wondering what to do with this one. Is relatively specific to a managed temp. in the RHS, and making the assumption that a particular pattern uses a temp for something managed feels wonky, since unrelated changes to how the RHS is compiled might break it easily.

What do you think of creating a test directory for regression tests specifically, so we can have tests like issue/1109.ts?

@MaxGraey
Copy link
Member

Sounds great! It specially important when we have major update/refactoring of compiler

@dcodeIO dcodeIO merged commit fa5d4db into master Feb 14, 2020
@dcodeIO dcodeIO deleted the issue-1095 branch March 15, 2020 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

postfix ! causes runtime exception when assigning nullable variable to non-nullable variable
2 participants