/*
 * 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';
const i: unique symbol = Symbol();
class j {
    p?: number;
    t?: string;
    u?: boolean;
    1?: number;
    "x"?: number;
    [i]?: number;
}
let k = 10;
let l = { p: 20 };
let m: symbol;
namespace o {
    export let p = 30;
}
o.p;
let p = {
    p: 1,
    t: "12",
    1: 1,
    "2": "2",
    [3]: 3,
    ["4"]: "4",
    [m = Symbol()]: 5,
    [i]: 6,
    ["1" + "2"]: 7,
    [1 + 2 + 3]: 8,
    [k]: 9,
    [k + 3]: 10,
    [l.p]: 11,
    [o.p]: 12,
    k: () => { return 13; },
    v: () => 14
};
assert(p.p === 1);
assert(p.t === '12');
assert(p[1] === 1);
assert(p["2"] === "2");
assert(p[3] === 3);
assert(p["4"] === "4");
assert(p[m] === 5);
assert(p[i] === 6);
assert(p["12"] === 7);
assert(p[6] === 8);
assert(p[10] === 9);
assert(p[13] === 10);
assert(p[20] === 11);
assert(p[30] === 12);
assert(p.k() === 13);
assert(p.v() === 14);
function g({ t: r, ...s }: {
    t: number;
    u: string;
}) {
    return r + s.u;
}
g({ t: 1, u: "213" });
assert(g({ t: 1, u: "213" }) === "1213");
function h(q: j) {
    assert(q.p === 1);
    assert(q.t === "1");
    assert(q.u === true);
    assert(q[1] === 1);
    assert(q["x"] === 2);
    assert(q[i] === 3);
}
h({ p: 1, t: "1", u: true, 1: 1, "x": 2, [i]: 3 });
