From 365ea3d9099cdfe953d95b8ee75e68cdf3e53e1b Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 3 Jun 2015 15:51:59 -0700 Subject: [PATCH] Check for ambient context instead of ambient flag --- src/compiler/checker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b0b6521e230..d904c670195 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10415,8 +10415,8 @@ module ts { }); } - // Non-ambient classes cannot merge with interfaces. - if (!(node.flags & NodeFlags.Ambient) && symbol.flags & SymbolFlags.Interface) { + // Interfaces cannot be merged with non-ambient classes. + if (symbol.flags & SymbolFlags.Interface && !isInAmbientContext(node)) { error(node, Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface) } @@ -10603,7 +10603,7 @@ module ts { // Interfaces cannot merge with non-ambient classes. if (symbol && symbol.declarations) { for (let declaration of symbol.declarations) { - if (declaration.kind === SyntaxKind.ClassDeclaration && !(declaration.flags & NodeFlags.Ambient)) { + if (declaration.kind === SyntaxKind.ClassDeclaration && !isInAmbientContext(declaration)) { error(node, Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface); break; }