diff --git a/lib/_tsc.js b/lib/_tsc.js index ffb38a01be4fa..d1ea13710bd93 100644 --- a/lib/_tsc.js +++ b/lib/_tsc.js @@ -50327,7 +50327,7 @@ function createTypeChecker(host) { return true; } if (requiresAddingUndefined && annotationType) { - annotationType = getOptionalType(annotationType, !isParameter(node)); + annotationType = addOptionality(annotationType, !isParameter(node)); } return !!annotationType && typeNodeIsEquivalentToType(node, type, annotationType) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type); } diff --git a/lib/typescript.js b/lib/typescript.js index 23672a730afdc..fa7c62f9a01aa 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -54930,7 +54930,7 @@ function createTypeChecker(host) { return true; } if (requiresAddingUndefined && annotationType) { - annotationType = getOptionalType(annotationType, !isParameter(node)); + annotationType = addOptionality(annotationType, !isParameter(node)); } return !!annotationType && typeNodeIsEquivalentToType(node, type, annotationType) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type); }