@@ -39811,7 +39811,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
39811
39811
// - 'object' in indexed access
39812
39812
// - target in rhs of import statement
39813
39813
const ok = (node.parent.kind === SyntaxKind.PropertyAccessExpression && (node.parent as PropertyAccessExpression).expression === node) ||
39814
- (node.parent.kind === SyntaxKind.ElementAccessExpression && (node.parent as ElementAccessExpression).expression === node) ||
39814
+ (node.parent.kind === SyntaxKind.ElementAccessExpression && (node.parent as ElementAccessExpression).expression === node) ||
39815
39815
((node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName) && isInRightSideOfImportOrExportAssignment(node as Identifier) ||
39816
39816
(node.parent.kind === SyntaxKind.TypeQuery && (node.parent as TypeQueryNode).exprName === node)) ||
39817
39817
(node.parent.kind === SyntaxKind.ExportSpecifier); // We allow reexporting const enums
@@ -39822,7 +39822,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
39822
39822
// TODO(jakebailey): write negative test case
39823
39823
// TODO(jakebailey): make error message mention const enum preservation
39824
39824
error(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);
39825
- } else if (type.symbol.valueDeclaration!.flags & NodeFlags.Ambient && !isValidTypeOnlyAliasUseSite(node)) {
39825
+ }
39826
+ else if (type.symbol.valueDeclaration!.flags & NodeFlags.Ambient && !isValidTypeOnlyAliasUseSite(node)) {
39826
39827
error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
39827
39828
}
39828
39829
}
@@ -39836,12 +39837,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
39836
39837
if (!otherFile.isDeclarationFile) {
39837
39838
// This file can only have come from the current project.
39838
39839
if (constEnumDeclaration.flags & NodeFlags.Ambient && !isValidTypeOnlyAliasUseSite(use)) {
39839
- return false
39840
+ return false;
39840
39841
}
39841
39842
return shouldPreserveConstEnums(compilerOptions);
39842
39843
}
39843
39844
const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject(otherFile.resolvedPath);
39844
- return redirect && shouldPreserveConstEnums(redirect.commandLine.options)
39845
+ return redirect && shouldPreserveConstEnums(redirect.commandLine.options);
39845
39846
}
39846
39847
39847
39848
function checkParenthesizedExpression(node: ParenthesizedExpression, checkMode?: CheckMode): Type {
0 commit comments