1/* 2 * Copyright (c) 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 16namespace A { 17 function foo(x: number): void; // OK, but have arkts-no-ts-overload 18 function foo(x: string): void; // OK, but have arkts-no-ts-overload 19 function foo(x: boolean): void {} // OK, but have arkts-no-ts-overload 20} 21 22namespace B { 23 class MyClass {} // OK 24} 25 26namespace B { 27 class MyClass {} // ERROR 28} 29 30namespace C { 31 let myVar: number = 42; // OK 32} 33 34namespace C { 35 let myVar: number = 42; // ERROR 36} 37 38namespace D { 39 let y: number = 1, z: number = 2; // OK 40} 41 42namespace F { 43 interface MyInterface {} // OK 44} 45 46namespace F { 47 interface MyInterface {} // ERROR 48} 49 50namespace G { 51 enum MyEnum { A, B, C } // OK 52} 53 54namespace G { 55 enum MyEnum { A, B, C } // ERROR 56} 57 58namespace H { 59 let a: number = 1, b: number = 2; // OK 60} 61 62namespace H { 63 let c: number = 3, d: number = 4; // OK 64} 65 66namespace I { 67 let a: number = 1, c: number = 2; 68} 69 70namespace I { 71 let b: number = 3, c: number = 4; // ERROR 72} 73 74 75 76