Document union extends scenarios for language review - #11977
Draft
iscai-msft wants to merge 2 commits into
Draft
iscai-msft wants to merge 2 commits into
iscai-msft wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
commit: |
Contributor
|
No changes needing a change description found. |
Replace runtime fixtures and Spector changes with a compact12-case review document. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
You can try these changes here
|
| union OpenPets extends Named { cat: Cat, dog: Dog, UnknownPet } | ||
|
|
||
| // UE11: Nested variant versus named/anonymous union constraint. | ||
| union NestedPets extends Named { pets: Pets, bird: Bird } |
There was a problem hiding this comment.
Will the Pets be flattened here?
| union OpenStatus extends string { known: "known", custom: string } | ||
| enum Direction { left, right } | ||
| union Directions extends Direction { left: Direction.left, right: Direction.right } | ||
| union PetArrays extends Named[] { cats: Cat[], dogs: Dog[] } |
There was a problem hiding this comment.
How does this case work? Limit to Named array?
|
|
||
| ## Serialization variations | ||
|
|
||
| For applicable cases, consider these formats without repeating identical answers: |
There was a problem hiding this comment.
Is this section for discriminated union? I suppose extends only add constraints but should not have any impact for API/payload.
| compiler-invalid. Inline arrays need a separate wire design, not a claimed | ||
| compiler prohibition. Do not infer unknown-tag fallback for closed unions. | ||
|
|
||
| ## Language response template |
There was a problem hiding this comment.
Little bit confused about the ask for languages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Union extends language review
Review the 12 scenarios: inheritance, structural compatibility, spread/model-is, ancestry, variant reuse, direct use, explicit base/default alternatives, union composition, and non-model constraints.
Please comment using this template. Group case IDs when the answer is the same:
Distinguish a limitation of the chosen representation from functionality that simply needs implementation.
union extendsis structural; it does not imply nominal inheritance, openness, or serialization.Open question: Does an object-envelope default describe the payload or the complete envelope, and how does its constraint apply? These semantics remain unspecified; the document does not invent a wire contract.
Related: Azure/typespec-azure#5390, microsoft/typespec#2737, and compiler PR #11771. This review informs, rather than implements, the Azure lint design.