diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 91a5c09454b09..a7f42b4686d3d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -44656,8 +44656,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (!checkTypeAssignableTo(typeWithThis, baseWithThis, /*errorNode*/ undefined)) { issueMemberSpecificError(node, typeWithThis, baseWithThis, Diagnostics.Class_0_incorrectly_extends_base_class_1); } - else { - // Report static side error only when instance type is assignable + else if (staticBaseType !== nullWideningType) { + // Report static side error only when instance type is assignable and base type is not null checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); } if (baseConstructorType.flags & TypeFlags.TypeVariable) { diff --git a/tests/baselines/reference/classExtendsNull2.errors.txt b/tests/baselines/reference/classExtendsNull2.errors.txt index d9231171757c0..82163357fa5ac 100644 --- a/tests/baselines/reference/classExtendsNull2.errors.txt +++ b/tests/baselines/reference/classExtendsNull2.errors.txt @@ -1,15 +1,12 @@ -classExtendsNull2.ts(5,7): error TS2417: Class static side 'typeof C' incorrectly extends base class static side 'null'. classExtendsNull2.ts(7,5): error TS17005: A constructor cannot contain a 'super' call when its class extends 'null'. -==== classExtendsNull2.ts (2 errors) ==== +==== classExtendsNull2.ts (1 errors) ==== // https://github.com/microsoft/TypeScript/issues/55499 interface Base {} class C extends null { - ~ -!!! error TS2417: Class static side 'typeof C' incorrectly extends base class static side 'null'. constructor() { super(); ~~~~~~~