-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Fix enum-driven visibility consistency issues when projections…
… are used (#5525) - Changed `getLifecycleVisibilityEnum` to honor projections when `program` is a `ProjectedProgram`. - Taught `Projector` to project `EnumValue` values only, so that they remain consistent with projected `Enum` and `EnumMember` references. If the projection of the underlying `EnumMember` does not result in another `EnumMember` (i.e. it projects to some other type, which I think should be rare, but possible according to the type system), the projector gives up and returns the original enum member. A more complex solution would try to project all values, but this could damage the scalar hierarchy and there is an open issue to consider removing projections in favor of mutators in the future. Closes #5450 Closes #5461 --------- Co-authored-by: Will Temple <[email protected]>
- Loading branch information
1 parent
1536482
commit abd3664
Showing
4 changed files
with
145 additions
and
5 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
.chronus/changes/witemple-visibility-projection-fix-2025-0-8-9-35-1.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
changeKind: fix | ||
packages: | ||
- "@typespec/compiler" | ||
--- | ||
|
||
Enum-driven visibility decorators and projections now interact correctly. | ||
|
||
Projections now project EnumValue values to preserve consistency with projected Enum/EnumMember types using a best-effort | ||
strategy. |
This file contains 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
This file contains 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
This file contains 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