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 type validation for type unions #947

Merged
merged 5 commits into from
Mar 27, 2023
Merged

Conversation

msujew
Copy link
Member

@msujew msujew commented Feb 17, 2023

Closes #943

Fixes two main issues:

  1. Allow to use type unions as return types of data type rules (if they are also a return type)
  2. Resolve union types as early as possible during assignability checking. This allows to use type unions as property types of declared interfaces.

@msujew msujew added the types Types related issue label Feb 17, 2023
Copy link
Contributor

@montymxb montymxb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments on extra test changes that should be reverted. Rest of the new test additions look nice however 👍 .

Copy link
Contributor

@montymxb montymxb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:octocat: approved! Looks good 👍 .

@msujew msujew added this to the v1.2.0 milestone Mar 27, 2023
@msujew msujew merged commit c279738 into main Mar 27, 2023
@msujew msujew deleted the msujew/resolve-type-union branch March 27, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types Types related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Declared interfaces can't use union string types in properties
2 participants