Skip to content

Commit a05d427

Browse files
Used containsUndefinedType in place of inline test.
1 parent 85f60d9 commit a05d427

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48222,7 +48222,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4822248222
function declaredParameterTypeContainsUndefined(parameter: ParameterDeclaration) {
4822348223
if (!parameter.type) return false;
4822448224
const type = getTypeFromTypeNode(parameter.type);
48225-
return type === undefinedType || !!(type.flags & TypeFlags.Union) && !!((type as UnionType).types[0].flags & TypeFlags.Undefined);
48225+
return containsUndefinedType(type);
4822648226
}
4822748227
function requiresAddingImplicitUndefined(parameter: ParameterDeclaration) {
4822848228
return (isRequiredInitializedParameter(parameter) || isOptionalUninitializedParameterProperty(parameter)) && !declaredParameterTypeContainsUndefined(parameter);

0 commit comments

Comments
 (0)