tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,9): error TS2322: Type '1' is not assignable to type 'D'.
tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class.
tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,9): error TS2322: Type '{ x: number; }' is not assignable to type 'F<T>'.
  Types of property 'x' are incompatible.
    Type 'number' is not assignable to type 'T'.
tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,9): error TS2409: Return type of constructor signature must be assignable to the instance type of the class.


==== tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts (4 errors) ====
    // a class constructor may return an expression, it must be assignable to the class instance type to be valid
    
    class C {
        constructor() {
            return 1;
        }
    }
    
    class D {
        x: number;
        constructor() {
            return 1; // error
            ~~~~~~~~~
!!! error TS2322: Type '1' is not assignable to type 'D'.
            ~~~~~~~~~
!!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class.
        }
    }
    
    class E {
        x: number;
        constructor() {
            return { x: 1 };
        }
    }
    
    class F<T> {
        x: T;
        constructor() {
            return { x: 1 }; // error
            ~~~~~~~~~~~~~~~~
!!! error TS2322: Type '{ x: number; }' is not assignable to type 'F<T>'.
!!! error TS2322:   Types of property 'x' are incompatible.
!!! error TS2322:     Type 'number' is not assignable to type 'T'.
            ~~~~~~~~~~~~~~~~
!!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class.
        }
    }
    
    class G<T> {
        x: T;
        constructor() {
            return { x: <T>null };
        }
    }