Skip to content

Commit b411fce

Browse files
committed
fmt
1 parent 28e105f commit b411fce

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39811,7 +39811,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3981139811
// - 'object' in indexed access
3981239812
// - target in rhs of import statement
3981339813
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) ||
3981539815
((node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName) && isInRightSideOfImportOrExportAssignment(node as Identifier) ||
3981639816
(node.parent.kind === SyntaxKind.TypeQuery && (node.parent as TypeQueryNode).exprName === node)) ||
3981739817
(node.parent.kind === SyntaxKind.ExportSpecifier); // We allow reexporting const enums
@@ -39822,7 +39822,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3982239822
// TODO(jakebailey): write negative test case
3982339823
// TODO(jakebailey): make error message mention const enum preservation
3982439824
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)) {
3982639827
error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
3982739828
}
3982839829
}
@@ -39836,12 +39837,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
3983639837
if (!otherFile.isDeclarationFile) {
3983739838
// This file can only have come from the current project.
3983839839
if (constEnumDeclaration.flags & NodeFlags.Ambient && !isValidTypeOnlyAliasUseSite(use)) {
39839-
return false
39840+
return false;
3984039841
}
3984139842
return shouldPreserveConstEnums(compilerOptions);
3984239843
}
3984339844
const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject(otherFile.resolvedPath);
39844-
return redirect && shouldPreserveConstEnums(redirect.commandLine.options)
39845+
return redirect && shouldPreserveConstEnums(redirect.commandLine.options);
3984539846
}
3984639847

3984739848
function checkParenthesizedExpression(node: ParenthesizedExpression, checkMode?: CheckMode): Type {

0 commit comments

Comments
 (0)