Skip to content

Commit e6ea85d

Browse files
committed
Properly build container list in binder.
Containers are added to container list only if they aren't already on the list. Fixes microsoft#325.
1 parent 13bbb98 commit e6ea85d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/compiler/binder.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,13 @@ module ts {
171171
parent = node;
172172
if (symbolKind & SymbolFlags.IsContainer) {
173173
container = node;
174-
if (lastContainer) lastContainer.nextContainer = container;
175-
lastContainer = container;
174+
// If container is not on container list, add it to the list
175+
if (lastContainer !== container && !container.nextContainer) {
176+
if (lastContainer) {
177+
lastContainer.nextContainer = container;
178+
}
179+
lastContainer = container;
180+
}
176181
}
177182
forEachChild(node, bind);
178183
container = saveContainer;

0 commit comments

Comments
 (0)