pre-suppress errors before enabling experimental.object_freeze_fix#47141
Closed
panagosg7 wants to merge 2 commits into
Closed
pre-suppress errors before enabling experimental.object_freeze_fix#47141panagosg7 wants to merge 2 commits into
panagosg7 wants to merge 2 commits into
Conversation
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
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
Contributor
|
This pull request has been merged in 363818e. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_fixflag 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