Skip to content

pre-suppress errors before enabling experimental.object_freeze_fix#47141

Closed
panagosg7 wants to merge 2 commits into
facebook:mainfrom
panagosg7:export-D64699992
Closed

pre-suppress errors before enabling experimental.object_freeze_fix#47141
panagosg7 wants to merge 2 commits into
facebook:mainfrom
panagosg7:export-D64699992

Conversation

@panagosg7
Copy link
Copy Markdown
Contributor

Summary:
D64152004 fixed a soundness hole in Flow's checking of frozen object types (e.g. try-Flow https://fburl.com/rmct2mf6). This diff suppresses Flow errors that appear when this fix is enabled (experimental.object_freeze_fix flag is set).

For most of these cases the result of Object.freeze() is assigned to some variable typed as a mutable type. The variable is then passed to a context where its fields can be written to. Thus changing the annotation type to a readonly version would only cause more errors downstream. So, instead, these assignments are suppressed so that the choice of using Object.freeze can be revisited.

Differential Revision: D64699992

Summary:

D64152004 fixed a soundness hole in Flow's checking of frozen object types (e.g. try-Flow https://fburl.com/rmct2mf6)

This diff prevents Flow errors from appearing when `experimental.object_freeze_fix` flag is set.

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D64641920
Summary:
D64152004 fixed a soundness hole in Flow's checking of frozen object types (e.g. try-Flow https://fburl.com/rmct2mf6). This diff suppresses Flow errors that appear when this fix is enabled (`experimental.object_freeze_fix` flag is set).

For most of these cases the result of `Object.freeze()` is assigned to some variable typed as a mutable type. The variable is then passed to a context where its fields can be written to. Thus changing the annotation type to a readonly version would only cause more errors downstream. So, instead, these assignments are suppressed so that the choice of using Object.freeze can be revisited.

Differential Revision: D64699992
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 21, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D64699992

facebook-github-bot pushed a commit to facebook/metro that referenced this pull request Oct 22, 2024
Summary:
X-link: facebook/react-native#47141

D64152004 fixed a soundness hole in Flow's checking of frozen object types (e.g. try-Flow https://fburl.com/rmct2mf6). This diff suppresses Flow errors that appear when this fix is enabled (`experimental.object_freeze_fix` flag is set).

For most of these cases the result of `Object.freeze()` is assigned to some variable typed as a mutable type. The variable is then passed to a context where its fields can be written to. Thus changing the annotation type to a readonly version would only cause more errors downstream. So, instead, these assignments are suppressed so that the choice of using Object.freeze can be revisited.

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D64699992

fbshipit-source-id: 48e4376d4ed3dbda21d32cabe512e6457384994f
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Oct 22, 2024
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 363818e.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants