/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import n from 'assert';
let o = 1;
n(o === 1);
function a() {
    return o;
}
a();
n(a() === o);
function b() {
    function i1() {
        function k1() {
            return o;
        }
        k1();
        n(k1() === o);
        return k1;
    }
    function j1() {
        return 2;
    }
    n(j1() === o + 1);
    i1()();
    n(i1()() === o);
    return i1;
}
b();
n(b()()() === o);
function c(...h1) {
    h1[0];
    h1[1];
    h1[2]()()();
    return h1[0] + h1[1] + h1[2]()()();
}
c(1, 2, b);
n(c(1, 2, b) === 1 + 2 + o);
function d({}) {
    return o;
}
d(c);
n(d(c) === o);
function e({ ...g1 }) {
    g1.a;
    g1.b(c);
    return g1.a + g1.b(c);
}
e({ a: 1, b: d });
n(e({ a: 1, b: d }) === 1 + o);
function f({ a: f1 }) {
    f1;
    return f1;
}
f({ a: 1 });
n(f({ a: 1 }) === 1);
function g({ a: d1, ...e1 }) {
    d1;
    e1.c;
    e1.d({ a: 1 });
    return e1.c + e1.d({ a: d1 });
}
g({ a: "1", c: f({ a: 1 }), d: f });
n(g({ a: "1", c: f({ a: 1 }), d: f }) === "11");
function h({ a: a1, "c": b1, ...c1 }) {
    a1;
    b1.c;
    c1.d({ a: 1 });
    return b1.c + c1.d({ a: a1 });
}
h({ a: "1", c: { c: f({ a: 1 }) }, d: f });
n(h({ a: "1", c: { c: f({ a: 1 }) }, d: f }) === "11");
function i({ a: y = 1, b: z = y }) {
    y;
    z;
    return z;
}
i({ a: 1 });
n(i({ a: 1 }) === 1);
function j(x = 1) {
    x;
    return x;
}
j();
n(j() === 1);
function k(u?: string, v?: number, ...w: number[]) {
    u;
    v;
    w[0];
    return u! + v! + w[0] + w[1];
}
k("a", 1, 2, 3, 4);
n(k("a", 1, 2, 3, 4) === "a123");
function l(s: number, t: string) {
    return s + t;
}
l(1, "a");
n(l(1, "a") === "1a");
let p = 1;
function m(q: number, r: string) {
    return q + r + p;
}
n(m(1, "1") === "111");
