Skip to content

Commit

Permalink
tweak fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Dec 19, 2024
1 parent 07cda04 commit 170d9fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6267,7 +6267,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
return true;
}
if (requiresAddingUndefined && annotationType) {
annotationType = getOptionalType(annotationType, !isParameter(node));
annotationType = addOptionality(annotationType, !isParameter(node));
}
return !!annotationType && typeNodeIsEquivalentToType(node, type, annotationType) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type);
},
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/expressionToTypeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ export function createSyntacticTypeNodeBuilder(
}
function typeFromProperty(node: PropertyDeclaration | PropertySignature | JSDocPropertyTag, symbol: Symbol, context: SyntacticTypeNodeBuilderContext) {
const declaredType = getEffectiveTypeAnnotationNode(node);
const requiresAddingUndefined = strictNullChecks && resolver.requiresAddingImplicitUndefined(node, symbol, context.enclosingDeclaration);
const requiresAddingUndefined = resolver.requiresAddingImplicitUndefined(node, symbol, context.enclosingDeclaration);
let resultType = failed;
if (declaredType) {
resultType = syntacticResult(serializeTypeAnnotationOfDeclaration(declaredType, context, node, symbol, requiresAddingUndefined));
Expand Down

0 comments on commit 170d9fd

Please sign in to comment.