tests/cases/compiler/derivedClassConstructorWithExplicitReturns01.ts(20,9): error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'C'.


==== tests/cases/compiler/derivedClassConstructorWithExplicitReturns01.ts (1 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);
            ~~~~~~~~
!!! error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'C'.
    
            if (Math.random() < 0.5) {
                "You win!"
                return {
                    cProp: 1,
                    dProp: () => this,
                    foo() { return "You win!!!!!" }
                };
            }
            else
                return null;
        }
    }