==== tests/cases/compiler/functionImplementationErrors.ts (8 errors) ====
    // FunctionExpression with no return type annotation with multiple return statements with unrelated types
    var f1 = function () {
             ~~~~~~~~~~~~~
        return '';
    ~~~~~~~~~~~~~~
        return 3;
    ~~~~~~~~~~~~~
    };
    ~
!!! functionImplementationErrors.ts(2,10): error TS2198: Could not find the best common type of types of all return statement expressions.
    var f2 = function x() {
             ~~~~~~~~~~~~~~
        return '';
    ~~~~~~~~~~~~~~
        return 3;
    ~~~~~~~~~~~~~
    };
    ~
!!! functionImplementationErrors.ts(6,10): error TS2198: Could not find the best common type of types of all return statement expressions.
    var f3 = () => {
             ~~~~~~~
        return '';
    ~~~~~~~~~~~~~~
        return 3;
    ~~~~~~~~~~~~~
    };
    ~
!!! functionImplementationErrors.ts(10,10): error TS2198: Could not find the best common type of types of all return statement expressions.
    
    // FunctionExpression with no return type annotation with return branch of number[] and other of string[]
    var f4 = function () {
             ~~~~~~~~~~~~~
        if (true) {
    ~~~~~~~~~~~~~~~
            return [''];
    ~~~~~~~~~~~~~~~~~~~~
        } else {
    ~~~~~~~~~~~~
            return [1];
    ~~~~~~~~~~~~~~~~~~~
        }
    ~~~~~
    }
    ~
!!! functionImplementationErrors.ts(16,10): error TS2198: Could not find the best common type of types of all return statement expressions.
    
    // Function implemetnation with non -void return type annotation with no return
    function f5(): number {
                   ~~~~~~
!!! functionImplementationErrors.ts(25,16): error TS2131: Function declared a non-void return type, but has no return expression.
    }
    
    var m;
    // Function signature with parameter initializer referencing in scope local variable
    function f6(n = m) {
                    ~
!!! functionImplementationErrors.ts(30,17): error TS2190: Initializer of parameter 'n' cannot reference identifier 'm' declared after it.
        var m = 4;
    }
    
    // Function signature with initializer referencing other parameter to the right
    function f7(n = m, m?) {
                    ~
!!! functionImplementationErrors.ts(35,17): error TS2190: Initializer of parameter 'n' cannot reference identifier 'm' declared after it.
    }
    
    // FunctionExpression with non -void return type annotation with a throw, no return, and other code
    // Should be error but isn't
    undefined === function (): number {
                               ~~~~~~
!!! functionImplementationErrors.ts(40,28): error TS2131: Function declared a non-void return type, but has no return expression.
        throw undefined;
        var x = 4;
    };
    