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

[CP] Fix issues with type propagation inside catch-blocks #49923

Closed
mraleph opened this issue Sep 8, 2022 · 4 comments
Closed

[CP] Fix issues with type propagation inside catch-blocks #49923

mraleph opened this issue Sep 8, 2022 · 4 comments
Assignees
Labels
cherry-pick-approved Label for approved cherrypick request

Comments

@mraleph
Copy link
Member

mraleph commented Sep 8, 2022

Commit(s) to merge

6ad3805, f38a280

Target

both

Issue Description

Compiler is confused about what a local variable accessed in a try-block can contain: e.g. it might think that late variable is already initialized or remove a necessary null-check from a parameter which is nullable.

What is the fix

Type propagation rules are updated to avoid incorrect type inference.

Why cherry-pick

Real world users are hitting these bugs and they are hard to diagnose and work around.

Risk

low

Issue link(s)

flutter/flutter#111088
flutter/flutter#110715

Extra Info

No response

@mraleph
Copy link
Member Author

mraleph commented Sep 8, 2022

/cc @alexmarkov (did both fixes)

@mit-mit
Copy link
Member

mit-mit commented Sep 8, 2022

Picking SGTM

@vsmenon
Copy link
Member

vsmenon commented Sep 8, 2022

lgtm

@mraleph mraleph added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Sep 8, 2022
@itsjustkevin itsjustkevin added cherry-pick-approved Label for approved cherrypick request and removed area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. cherry-pick-review Issue that need cherry pick triage to approve labels Sep 12, 2022
@sortie
Copy link
Contributor

sortie commented Sep 13, 2022

I've cherry-picked the two commits to 2.18.1 as c42a304.

@sortie sortie closed this as completed Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Label for approved cherrypick request
Projects
None yet
Development

No branches or pull requests

7 participants