Skip to content

Add failing tests for union object type addition#55602

Open
elicwhite wants to merge 1 commit intofacebook:mainfrom
elicwhite:export-D93262587
Open

Add failing tests for union object type addition#55602
elicwhite wants to merge 1 commit intofacebook:mainfrom
elicwhite:export-D93262587

Conversation

@elicwhite
Copy link
Member

Summary:
The compat check v2 does not correctly detect when a new object type is added to a union used in a function parameter flowing to native. This adds test fixtures and test cases that reproduce this bug: adding ObjectC to an ObjectA | ObjectB union should be flagged as incompatible (native won't expect the new type), and removing ObjectC should be flagged as ok (native can handle fewer types). Currently the tests fail because the sorting logic treats all TypeAliasTypeAnnotation members as equal, causing the merge-comparison to misidentify added/removed members as type mismatches.

Changelog: [Internal]

Differential Revision: D93262587

Summary:
The compat check v2 does not correctly detect when a new object type is added to a union used in a function parameter flowing to native. This adds test fixtures and test cases that reproduce this bug: adding ObjectC to an ObjectA | ObjectB union should be flagged as incompatible (native won't expect the new type), and removing ObjectC should be flagged as ok (native can handle fewer types). Currently the tests fail because the sorting logic treats all TypeAliasTypeAnnotation members as equal, causing the merge-comparison to misidentify added/removed members as type mismatches.

Changelog: [Internal]

Differential Revision: D93262587
@meta-cla meta-cla 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 Feb 18, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 18, 2026

@elicwhite has exported this pull request. If you are a Meta employee, you can view the originating Diff in D93262587.

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 meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments