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

Collapse unions of objects with an inferable discriminator into tagged unions #12129

Merged
merged 3 commits into from
Oct 18, 2023

Conversation

jeskew
Copy link
Contributor

@jeskew jeskew commented Oct 12, 2023

Split off from work on #9736, which requires a couple changes that are easier to consider as standalone PRs.

This PR updates the TypeCollapser to handle unions of objects that share a required, string-literal-typed property for which each member of the union has a unique value. (If there are multiple viable discriminators, the TypeCollapser will try to use a property named type or kind, then fall back to the first viable discriminator name in an ordinal alphabetic sort.)

Microsoft Reviewers: Open in CodeFlow

@jeskew jeskew requested a review from a team October 12, 2023 18:14
@github-actions
Copy link
Contributor

github-actions bot commented Oct 12, 2023

Test this change out locally with the following install scripts (Action run 6560930679)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 6560930679
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 6560930679"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 6560930679
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 6560930679"

@github-actions
Copy link
Contributor

Test Results

     132 files  ±  0       132 suites  ±0   4h 2m 33s ⏱️ + 19m 36s
10 671 tests +  3  10 671 ✔️ +  4  0 💤 ±0  0  - 1 
51 571 runs  +12  51 571 ✔️ +13  0 💤 ±0  0  - 1 

Results for commit fb9614b. ± Comparison against base commit 48a96c1.

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 3fb6cd0 into main Oct 18, 2023
47 checks passed
@jeskew jeskew deleted the jeskew/tagged-union-intellisense-improvements branch October 18, 2023 12:34
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

2 participants