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

Improve migration of intersection types #3112

Closed
SupunS opened this issue Feb 15, 2024 · 0 comments · Fixed by #3118
Closed

Improve migration of intersection types #3112

SupunS opened this issue Feb 15, 2024 · 0 comments · Fixed by #3118
Assignees

Comments

@SupunS
Copy link
Member

SupunS commented Feb 15, 2024

Update the static type migration to convert owned intersection types

  • T{} / Any*{} to T/Any*

    If the intersection type has no interface types, then return the legacy type as-is.

    This prevents the migration from creating an intersection type with no interface types, as static to sema type conversion ignores the legacy type.

  • Any*{A,...} -> {A,...}

    If the intersection type has no or an AnyStruct/AnyResource legacy type, and has at least one interface type, then return the intersection type without the legacy type.

  • T{A,...} -> T

    If the intersection type has a legacy type, and has at least one interface type, then return the legacy type as-is.

@SupunS SupunS self-assigned this Feb 15, 2024
@turbolent turbolent changed the title Convert AnyStruct{I}/AnyResource{I} restricted types to {I} in state-migration Improve migration of AnyStruct/AnyResource{I} and AnyStruct/AnyResource{} in state-migration Feb 15, 2024
@turbolent turbolent assigned turbolent and unassigned SupunS Feb 15, 2024
@turbolent turbolent changed the title Improve migration of AnyStruct/AnyResource{I} and AnyStruct/AnyResource{} in state-migration Improve migration of intersection types Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants