/*
 * 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 assert from 'assert';
//array
let a1 = 1;
let arr = [0, a1, 3];
assert(a1 === 1);
assert(arr[0] === 0);
assert(arr[1] === 1);
assert(arr[2] === 3);
let [b1, c1, d] = arr;
assert(b1 === 0);
assert(c1 === 1);
assert(d === 3);
[, ,] = [...arr];
//object
let obj = { k: 1, l: a1 + 1, m: 3 };
assert(obj.k === 1);
assert(obj.l === 2);
assert(obj.m === 3);
let { m: b2, k: c2, l: d2 } = obj;
assert(b2 === 3);
assert(c2 === 1);
assert(d2 === 2);
class C1 {
    k: number;
    l: number;
    m: number;
    constructor([h, i, j]: Array<number>) {
        this.k = h;
        this.l = i;
        this.m = j;
    }
}
function f1([a, b, c]: Array<number>, { k: e, l: f, m: g }: C1) {
    a;
    b;
    c;
    e;
    f;
    g;
    assert(a === 10);
    assert(b === 21);
    assert(c === 20);
    assert(e === 0);
    assert(f === 1);
    assert(g === 3);
}
f1([10, a1 + 20, 20], new C1([...arr]));
