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 16function main(): void { 17 let preA : a; 18 19 type a = Double; 20 21 let a : a; 22 23 a = 1.1; 24} 25 26function foo(){ 27 28 switch (1) { 29 case 0: 30 type dsa = Double; 31 let dsa : dsa; 32 break 33 case 1: 34 let asd: asd; 35 break 36 default : 37 type asd = number; 38 } 39 40 { 41 let asd : asd; 42 type asd = number; 43 type dsa = Double; 44 let dsa : dsa; 45 } 46 47 while (true) { 48 let asd : asd; 49 type asd = Object; 50 type dsa = Double; 51 let dsa : dsa; 52 break; 53 } 54 55 for (let k: int = 0; k < 10; k++) { 56 let asd : asd; 57 type asd = Double; 58 59 type dsa = Double; 60 let dsa : dsa; 61 } 62 63 try { 64 let asd : asd; 65 type asd = Double; 66 67 type dsa = Double; 68 let dsa : dsa; 69 } catch (e){ 70 let asd : asd; 71 type asd = Double; 72 73 type dsa = Double; 74 let dsa : dsa; 75 } 76 77} 78