Skip to content

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

Description

@mraleph

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

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions