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

Preserve literal elements in string union types #6933

Merged
merged 2 commits into from
May 23, 2022

Conversation

jeskew
Copy link
Contributor

@jeskew jeskew commented May 23, 2022

This PR removes an optimization in the type loader that cast union types with a mixture of string literals and string down to the base string type. The purpose of this change is to enable completions on extensible enums (which take the form of 'some' | 'literal' | 'values' | string); type checking is unaffected, as 'some' | 'literal' | 'values' | string and string have the same domain.

This is a companion to (but not dependent on) Azure/bicep-types-az#828

Microsoft Reviewers: Open in CodeFlow

@jeskew jeskew requested a review from a team May 23, 2022 15:24
Copy link
Contributor

@shenglol shenglol left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Member

@majastrz majastrz left a comment

Choose a reason for hiding this comment

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

:shipit:

@jeskew jeskew merged commit 31499c3 into main May 23, 2022
@jeskew jeskew deleted the jeskew/preserve-literals-in-string-union-types branch May 23, 2022 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants