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

Fix union as enum issues #328

Merged
merged 7 commits into from
Feb 28, 2024
Merged

Fix union as enum issues #328

merged 7 commits into from
Feb 28, 2024

Conversation

tadelesh
Copy link
Member

fix: #326

@azure-sdk
Copy link
Collaborator

All changed packages have been documented.

@azure-sdk
Copy link
Collaborator

strictEqual(dogValue.enumType, petKind);
strictEqual(dogValue.valueType, petKind.valueType);
strictEqual(dogValue.kind, "enumvalue");
});

it("property of anonymous union as enum", async () => {
await runner.compileWithBuiltInService(`
model Pet {
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't want to create an enum from an anonymous union, we only do it if the union is named. let me roll back this part of the pr, rest looks good as far as i can see

Copy link
Member

Choose a reason for hiding this comment

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

is this not true anymore?

Copy link
Contributor

Choose a reason for hiding this comment

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

i didn't know we changed this, i know @lmazuel before really didn't want to generate a named enum from anonymous unions. can you approve it as is and @tadelesh depending on what @lmazuel says can you make a separate PR if we do want to name anonymous unions?

@iscai-msft iscai-msft enabled auto-merge (squash) February 28, 2024 21:24
@iscai-msft iscai-msft merged commit e161a87 into main Feb 28, 2024
14 checks passed
@iscai-msft iscai-msft deleted the fix_union_variant branch February 28, 2024 22:50
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.

wrong type for discriminator with union as enum value variant
4 participants