Skip to content

Commit

Permalink
Reverted emit to original in error case.
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomirtitian committed Sep 27, 2024
1 parent adf815d commit c8cca30
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6742,9 +6742,6 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
function createAnonymousTypeNode(type: ObjectType): TypeNode {
const typeId = type.id;
const symbol = type.symbol;
// if (checkTruncationLength(context)) {
// return createElidedInformationPlaceholder(context);
// }
if (symbol) {
const isInstantiationExpressionType = !!(getObjectFlags(type) & ObjectFlags.InstantiationExpressionType);
if (isInstantiationExpressionType) {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/expressionToTypeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ export function createSyntacticTypeNodeBuilder(
if (declaredType) {
resultType = syntacticResult(serializeTypeAnnotationOfDeclaration(declaredType, context, node, symbol));
}
else if (node.initializer) {
else if (node.initializer && symbol.declarations?.length === 1) {
if (!resolver.isExpandoFunctionDeclaration(node) && !isContextuallyTyped(node)) {
resultType = typeFromExpression(node.initializer, context, /*isConstContext*/ undefined, /*requiresAddingUndefined*/ undefined, isVarConstLike(node));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ var x = 10; // Error reported

//// [out.d.ts]
declare var x: string;
declare var x: number;
declare var x: string;

0 comments on commit c8cca30

Please sign in to comment.