error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
derivedClassConstructorWithExplicitReturns01.ts(31,13): error TS2322: Type 'null' is not assignable to type 'D'.
derivedClassConstructorWithExplicitReturns01.ts(31,13): error TS2409: Return type of constructor signature must be assignable to the instance type of the class.


!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== derivedClassConstructorWithExplicitReturns01.ts (2 errors) ====
    class C {
        cProp = 10;
    
        foo() { return "this never gets used."; }
    
        constructor(value: number) {
            return {
                cProp: value,
                foo() {
                    return "well this looks kinda C-ish.";
                }
            }
        }
    }
    
    class D extends C {
        dProp = () => this;
    
        constructor(a = 100) {
            super(a);
    
            if (Math.random() < 0.5) {
                "You win!"
                return {
                    cProp: 1,
                    dProp: () => this,
                    foo() { return "You win!!!!!" }
                };
            }
            else
                return null;
                ~~~~~~
!!! error TS2322: Type 'null' is not assignable to type 'D'.
                ~~~~~~
!!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class.
        }
    }