Skip to content

Commit 365ea3d

Browse files
author
Arthur Ozga
committed
Check for ambient context instead of ambient flag
1 parent 323ce24 commit 365ea3d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10415,8 +10415,8 @@ module ts {
1041510415
});
1041610416
}
1041710417

10418-
// Non-ambient classes cannot merge with interfaces.
10419-
if (!(node.flags & NodeFlags.Ambient) && symbol.flags & SymbolFlags.Interface) {
10418+
// Interfaces cannot be merged with non-ambient classes.
10419+
if (symbol.flags & SymbolFlags.Interface && !isInAmbientContext(node)) {
1042010420
error(node, Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface)
1042110421
}
1042210422

@@ -10603,7 +10603,7 @@ module ts {
1060310603
// Interfaces cannot merge with non-ambient classes.
1060410604
if (symbol && symbol.declarations) {
1060510605
for (let declaration of symbol.declarations) {
10606-
if (declaration.kind === SyntaxKind.ClassDeclaration && !(declaration.flags & NodeFlags.Ambient)) {
10606+
if (declaration.kind === SyntaxKind.ClassDeclaration && !isInAmbientContext(declaration)) {
1060710607
error(node, Diagnostics.Only_an_ambient_class_can_be_merged_with_an_interface);
1060810608
break;
1060910609
}

0 commit comments

Comments
 (0)