Skip to content

Commit 5ab5338

Browse files
committed
Fix declaration emitter scoping issue for type parameter constraints
1 parent 3055445 commit 5ab5338

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiler/declarationEmitter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,9 @@ namespace ts {
13091309
}
13101310

13111311
function emitSignatureDeclaration(node: SignatureDeclaration) {
1312+
const prevEnclosingDeclaration = enclosingDeclaration;
1313+
enclosingDeclaration = node;
1314+
13121315
// Construct signature or constructor type write new Signature
13131316
if (node.kind === SyntaxKind.ConstructSignature || node.kind === SyntaxKind.ConstructorType) {
13141317
write("new ");
@@ -1321,9 +1324,6 @@ namespace ts {
13211324
write("(");
13221325
}
13231326

1324-
const prevEnclosingDeclaration = enclosingDeclaration;
1325-
enclosingDeclaration = node;
1326-
13271327
// Parameters
13281328
emitCommaList(node.parameters, emitParameterDeclaration);
13291329

0 commit comments

Comments
 (0)