Skip to content

Commit 864a7d3

Browse files
committed
Let anything be an enclosing declaration in the declaration transformer
1 parent 0000e52 commit 864a7d3

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/compiler/transformers/declarations.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -677,15 +677,20 @@ namespace ts {
677677
return hasEffectiveModifier(node, ModifierFlags.Private) ? undefined : visitNodes(params, visitDeclarationSubtree);
678678
}
679679

680-
function isEnclosingDeclaration(node: Node) {
681-
return isSourceFile(node)
682-
|| isTypeAliasDeclaration(node)
683-
|| isModuleDeclaration(node)
684-
|| isClassDeclaration(node)
685-
|| isInterfaceDeclaration(node)
686-
|| isFunctionLike(node)
687-
|| isIndexSignatureDeclaration(node)
688-
|| isMappedTypeNode(node);
680+
function isEnclosingDeclaration(_node: Node) {
681+
// TODO(jakebailey): Clean this up. If we look at the way that the "types"
682+
// baselines work, the enclosing declaration can be any node in the tree,
683+
// so limiting what we use as enclosing declarations here is inconsistent
684+
// and causes differences between .types and .d.ts baselines.
685+
return true;
686+
// return isSourceFile(node)
687+
// || isTypeAliasDeclaration(node)
688+
// || isModuleDeclaration(node)
689+
// || isClassDeclaration(node)
690+
// || isInterfaceDeclaration(node)
691+
// || isFunctionLike(node)
692+
// || isIndexSignatureDeclaration(node)
693+
// || isMappedTypeNode(node);
689694
}
690695

691696
function checkEntityNameVisibility(entityName: EntityNameOrEntityNameExpression, enclosingDeclaration: Node) {

0 commit comments

Comments
 (0)