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 16type custom_tuple_type = [string, int]; 17 18class A {foo(){}} 19class B extends A {bar(){}} 20 21function main(): void { 22 let a_tup: [[int, number], [custom_tuple_type], [A, B], custom_tuple_type[]] = [[2, 3], [["a", 6]], [new B(), new B()], [["b", 8], ["c", 10], ["d", 12]]]; 23 let my_str: String = a_tup[1][0][0]; 24 let my_str_2: String = a_tup[3][0][0]; 25 a_tup[2][0].foo(); 26 a_tup[2][1].bar(); 27} 28