1/* 2 * Copyright (c) 2023-2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16let x = { "name": 1, 2: 3 } 17 18console.log(x["name"]) 19console.log(x[2]) 20 21class X { 22 public name: number = 0 23} 24interface GeneratedObjectLiteralInterface_1 { 25 name: number; 26} 27let y: GeneratedObjectLiteralInterface_1 = {name: 1} 28console.log(x.name) 29 30let z = [1, 2, 3] 31console.log(y[2]) 32 33enum S1 { 34 s1 = "qwqwq", 35} 36 37enum S2 { 38 s2 = 123, 39} 40 41interface A1 { 42 [S1.s1]: string; 43} 44 45interface A2 { 46 [S2.s2]: string; 47} 48 49const a1: A1 = { 50 [S1.s1]: "fld1", 51}; 52 53const a2: A2 = { 54 [S2.s2]: "fld2", 55}; 56 57S1["s1"]; 58S2["s2"]; 59