mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-15 03:09:59 -05:00
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
This commit is contained in:
@@ -47830,11 +47830,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
}
|
||||
|
||||
checkGrammarModifiers(node);
|
||||
const isImportEquals = isInternalModuleImportEqualsDeclaration(node);
|
||||
if (compilerOptions.erasableSyntaxOnly && isImportEquals && !(node.flags & NodeFlags.Ambient)) {
|
||||
if (compilerOptions.erasableSyntaxOnly && !(node.flags & NodeFlags.Ambient)) {
|
||||
error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
||||
}
|
||||
if (isImportEquals || checkExternalImportOrExportDeclaration(node)) {
|
||||
if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
|
||||
checkImportBinding(node);
|
||||
markLinkedReferences(node, ReferenceHint.ExportImportEquals);
|
||||
if (node.moduleReference.kind !== SyntaxKind.ExternalModuleReference) {
|
||||
@@ -47975,6 +47974,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
return;
|
||||
}
|
||||
|
||||
if (compilerOptions.erasableSyntaxOnly && !(node.flags & NodeFlags.Ambient)) {
|
||||
error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
||||
}
|
||||
const container = node.parent.kind === SyntaxKind.SourceFile ? node.parent : node.parent.parent as ModuleDeclaration;
|
||||
if (container.kind === SyntaxKind.ModuleDeclaration && !isAmbientModule(container)) {
|
||||
if (node.isExportEquals) {
|
||||
|
||||
Reference in New Issue
Block a user