Skip to content

Commit 170d9fd

Browse files
committed
tweak fix
1 parent 07cda04 commit 170d9fd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6267,7 +6267,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
62676267
return true;
62686268
}
62696269
if (requiresAddingUndefined && annotationType) {
6270-
annotationType = getOptionalType(annotationType, !isParameter(node));
6270+
annotationType = addOptionality(annotationType, !isParameter(node));
62716271
}
62726272
return !!annotationType && typeNodeIsEquivalentToType(node, type, annotationType) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type);
62736273
},

src/compiler/expressionToTypeNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ export function createSyntacticTypeNodeBuilder(
814814
}
815815
function typeFromProperty(node: PropertyDeclaration | PropertySignature | JSDocPropertyTag, symbol: Symbol, context: SyntacticTypeNodeBuilderContext) {
816816
const declaredType = getEffectiveTypeAnnotationNode(node);
817-
const requiresAddingUndefined = strictNullChecks && resolver.requiresAddingImplicitUndefined(node, symbol, context.enclosingDeclaration);
817+
const requiresAddingUndefined = resolver.requiresAddingImplicitUndefined(node, symbol, context.enclosingDeclaration);
818818
let resultType = failed;
819819
if (declaredType) {
820820
resultType = syntacticResult(serializeTypeAnnotationOfDeclaration(declaredType, context, node, symbol, requiresAddingUndefined));

0 commit comments

Comments
 (0)