overloadOnConstConstraintChecks4.ts(11,5): error TS2322: Type 'null' is not assignable to type 'Z'.


==== overloadOnConstConstraintChecks4.ts (1 errors) ====
    class Z { }
    class A extends Z { private x = 1 }
    class B extends A {}
    class C extends A {
        public foo() { }
    }
    function foo(name: 'hi'): B;
    function foo(name: 'bye'): C;
    function foo(name: string): A;
    function foo(name: any): Z {
        return null;
        ~~~~~~
!!! error TS2322: Type 'null' is not assignable to type 'Z'.
    }
    