Skip to content

Commit

Permalink
Do not mutate type stack (microsoft#4299)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin authored and sarangan12 committed Sep 16, 2024
1 parent c5773e6 commit 1cee1b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .chronus/changes/fix-type-stack-mutate-2024-7-29-13-18-20.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
changeKind: internal
packages:
- "@typespec/versioning"
---

3 changes: 1 addition & 2 deletions packages/versioning/src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,7 @@ function getAvailabilityMapFromStack(
program: Program,
typeStack: Type[]
): Map<string, Availability> | undefined {
let type;
while ((type = typeStack.shift())) {
for (const type of typeStack) {
const map = getAvailabilityMap(program, type);
if (map) {
return map;
Expand Down

0 comments on commit 1cee1b7

Please sign in to comment.