1/* 2 * Copyright (c) 2024-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 16class A { 17 namespace ns { 18 dfdfsfdf 19 } 20 namespace hehe { 21 22 } 23 time: number = foo(); 24 private uri: string; 25 26 private routers() { 27 B.getInstance().navigation(this); 28 } 29 30 constructor(uri: string) { 31 this.uri = uri; 32 } 33} 34 35class B { 36 namespace ns { 37 38 }ddddddd 39 time: number = foo(); 40 private uri: string; 41 42 private routerssdsds() { 43 B.getInstance().navigation(this); 44 } 45 46 constructor(uri: string) { 47 this.uri = uri; 48 } 49} 50 51/* @@? 17:5 Error SyntaxError: Namespace is allowed only at the top level or inside a namespace. */ 52/* @@? 18:9 Error TypeError: Unresolved reference dfdfsfdf */ 53/* @@? 20:5 Error SyntaxError: Namespace is allowed only at the top level or inside a namespace. */ 54/* @@? 23:20 Error TypeError: Unresolved reference foo */ 55/* @@? 27:11 Error TypeError: Property 'getInstance' does not exist on type 'B' */ 56/* @@? 36:5 Error SyntaxError: Namespace is allowed only at the top level or inside a namespace. */ 57/* @@? 39:5 Error SyntaxError: Field type annotation expected. */ 58/* @@? 39:20 Error TypeError: This expression is not callable. */ 59/* @@? 43:11 Error TypeError: Property 'getInstance' does not exist on type 'B' */ 60