tests/cases/conformance/functions/parameterInitializersForwardReferencing1.ts(3,20): error TS2373: Parameter 'bar' cannot reference identifier 'foo' declared after it.
tests/cases/conformance/functions/parameterInitializersForwardReferencing1.ts(13,20): error TS2373: Parameter 'bar' cannot reference identifier 'foo' declared after it.
tests/cases/conformance/functions/parameterInitializersForwardReferencing1.ts(21,18): error TS2372: Parameter 'a' cannot reference itself.
tests/cases/conformance/functions/parameterInitializersForwardReferencing1.ts(25,22): error TS2372: Parameter 'async' cannot reference itself.
tests/cases/conformance/functions/parameterInitializersForwardReferencing1.ts(29,15): error TS2373: Parameter '{[foo]: bar}' cannot reference identifier 'foo' declared after it.
tests/cases/conformance/functions/parameterInitializersForwardReferencing1.ts(29,15): error TS2448: Block-scoped variable 'foo' used before its declaration.


==== tests/cases/conformance/functions/parameterInitializersForwardReferencing1.ts (6 errors) ====
    let foo: string = "";
    
    function f1 (bar = foo) { // unexpected compiler error; works at runtime
                       ~~~
!!! error TS2373: Parameter 'bar' cannot reference identifier 'foo' declared after it.
        var foo: number = 2;
        return bar; // returns 1
    }
    
    function f2 (bar = (baz = foo) => baz) { // unexpected compiler error; works at runtime
        var foo: number = 2;
        return bar(); // returns 1
    }
    
    function f3 (bar = foo, foo = 2) { // correct compiler error, error at runtime
                       ~~~
!!! error TS2373: Parameter 'bar' cannot reference identifier 'foo' declared after it.
        return bar;
    }
    
    function f4 (foo, bar = foo) {
        return bar
    }
    
    function f5 (a = a) {
                     ~
!!! error TS2372: Parameter 'a' cannot reference itself.
        return a
    }
    
    function f6 (async = async) {
                         ~~~~~
!!! error TS2372: Parameter 'async' cannot reference itself.
        return async
    }
    
    function f7({[foo]: bar}: any[]) {
                  ~~~
!!! error TS2373: Parameter '{[foo]: bar}' cannot reference identifier 'foo' declared after it.
                  ~~~
!!! error TS2448: Block-scoped variable 'foo' used before its declaration.
!!! related TS2728 tests/cases/conformance/functions/parameterInitializersForwardReferencing1.ts:30:9: 'foo' is declared here.
        let foo: number = 2;
    }
    
    class Foo {
        constructor(public x = 12, public y = x) {}
    }
    
    function f8(foo1: string, bar = foo1) { }
    