conditionalReturnExpression.ts(2,18): error TS2322: Type '1' is not assignable to type '3'.
conditionalReturnExpression.ts(2,23): error TS2322: Type '2' is not assignable to type '3'.
conditionalReturnExpression.ts(8,43): error TS2322: Type 'number' is not assignable to type 'string'.
conditionalReturnExpression.ts(19,71): error TS2322: Type 'number' is not assignable to type 'string'.


==== conditionalReturnExpression.ts (4 errors) ====
    function return1(x: boolean): 3 {
        return (x ? (1) : 2);
                     ~
!!! error TS2322: Type '1' is not assignable to type '3'.
                          ~
!!! error TS2322: Type '2' is not assignable to type '3'.
    }
    
    declare function getAny(): any;
    
    function return2(x: string): string {
        return x.startsWith("a") ? getAny() : 1;
                                              ~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
    }
    
    function return3(x: string): string {
        return x.startsWith("a") ? "a" : x;
    }
    
    function return4(x: string): string {
        return (x.startsWith("a") ? getAny() : 1) as string;
    }
    
    const return5 = (x: string): string => x.startsWith("a") ? getAny() : 1;
                                                                          ~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
    
    const return6 = (x: string): string => (x.startsWith("a") ? getAny() : 1) as string;