error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
parameterInitializersForwardReferencing.ts(6,20): error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
parameterInitializersForwardReferencing.ts(11,21): error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
parameterInitializersForwardReferencing.ts(11,28): error TS2373: Parameter 'b' cannot reference identifier 'c' declared after it.
parameterInitializersForwardReferencing.ts(17,21): error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
parameterInitializersForwardReferencing.ts(23,25): error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
parameterInitializersForwardReferencing.ts(32,21): error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
parameterInitializersForwardReferencing.ts(33,16): error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
parameterInitializersForwardReferencing.ts(37,14): error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
parameterInitializersForwardReferencing.ts(37,21): error TS2373: Parameter 'b' cannot reference identifier 'c' declared after it.
parameterInitializersForwardReferencing.ts(37,28): error TS2373: Parameter 'c' cannot reference identifier 'd' declared after it.


!!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
==== parameterInitializersForwardReferencing.ts (10 errors) ====
    function left(a, b = a, c = b) {
        a;
        b;
    }
    
    function right(a = b, b = a) {
                       ~
!!! error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
        a;
        b;
    }
    
    function right2(a = b, b = c, c = a) {
                        ~
!!! error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
                               ~
!!! error TS2373: Parameter 'b' cannot reference identifier 'c' declared after it.
        a;
        b;
        c;
    }
    
    function inside(a = b) {
                        ~
!!! error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
        var b;
    }
    
    function outside() {
        var b;
        function inside(a = b) { // Still an error because b is declared inside the function
                            ~
!!! error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
            var b;
        }
    }
    
    function defaultArgFunction(a = function () { return b; }, b = 1) { }
    function defaultArgArrow(a = () => () => b, b = 3) { }
    
    class C {
        constructor(a = b, b = 1) { }
                        ~
!!! error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
        method(a = b, b = 1) { }
                   ~
!!! error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
    }
    
    // Function expressions
    var x = (a = b, b = c, c = d) => { var d; };
                 ~
!!! error TS2373: Parameter 'a' cannot reference identifier 'b' declared after it.
                        ~
!!! error TS2373: Parameter 'b' cannot reference identifier 'c' declared after it.
                               ~
!!! error TS2373: Parameter 'c' cannot reference identifier 'd' declared after it.
    
    // Should not produce errors - can reference later parameters if they occur within a function expression initializer.
    function f(a, b = function () { return c; }, c = b()) {
    }