-
Notifications
You must be signed in to change notification settings - Fork 342
Open
Labels
bugSomething isn't workingSomething isn't workingcompiler:coreIssues for @typespec/compilerIssues for @typespec/compilertriaged:core
Milestone
Description
Describe the bug
I can do this:
model A {
@minValue(0)
index: int32 | "auto";
}but can't apply @minValue(0) decorator to the same union defined in a form of a named union.
Reproduction
union U {
@minValue(0)
number: int32;
"auto";
}
model B {
index: U
}Decorator throws an error:
Cannot apply @minValue decorator to int32 since it is not assignable to numeric | utcDateTime | offsetDateTime | plainDate | plainTime | duration | ModelProperty
Checklist
- Follow our Code of Conduct
- Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcompiler:coreIssues for @typespec/compilerIssues for @typespec/compilertriaged:core