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 16class A { 17 func1(list : number, final : number) { 18 while(true) { 19 if(false) { 20 break; 21 } else { 22 let endSequence = false 23 this.func(list, final, endSequence) 24 } 25 } 26 } 27} 28 29/* @@? 17:7 Error TypeError: Only abstract or native methods can't have body. */ 30/* @@? 17:23 Error SyntaxError: Parameter declaration should have an explicit type annotation. */ 31/* @@? 17:23 Error SyntaxError: Unexpected token, expected ',' or ')'. */ 32/* @@? 17:23 Error SyntaxError: Unexpected token, expected an identifier. */ 33/* @@? 17:29 Error SyntaxError: Unexpected token ':'. */ 34/* @@? 17:31 Error SyntaxError: number is a predefined type, cannot be used as an identifier */ 35/* @@? 17:37 Error SyntaxError: Unexpected token ')'. */ 36/* @@? 17:37 Error SyntaxError: Field type annotation expected. */ 37/* @@? 17:39 Error SyntaxError: Unexpected token '{'. */ 38/* @@? 18:3 Error SyntaxError: Unexpected token 'while'. */ 39/* @@? 18:8 Error SyntaxError: Unexpected token '('. */ 40/* @@? 18:9 Error SyntaxError: Unexpected token 'true'. */ 41/* @@? 18:13 Error SyntaxError: Unexpected token ')'. */ 42/* @@? 18:15 Error SyntaxError: Unexpected token '{'. */ 43/* @@? 19:4 Error SyntaxError: Unexpected token 'if'. */ 44/* @@? 19:6 Error SyntaxError: Unexpected token '('. */ 45/* @@? 19:7 Error SyntaxError: Unexpected token 'false'. */ 46/* @@? 19:12 Error SyntaxError: Unexpected token ')'. */ 47/* @@? 19:14 Error SyntaxError: Unexpected token '{'. */ 48/* @@? 20:5 Error SyntaxError: Unexpected token 'break'. */ 49/* @@? 21:6 Error SyntaxError: Unexpected token 'else'. */ 50/* @@? 21:11 Error SyntaxError: Unexpected token '{'. */ 51/* @@? 23:5 Error TypeError: Cannot reference 'this' in this context. */ 52/* @@? 23:10 Error TypeError: Property 'func' does not exist on type 'Error' */ 53/* @@? 23:21 Error SyntaxError: Unexpected token 'final'. */ 54/* @@? 25:3 Error SyntaxError: Unexpected token '}'. */ 55/* @@? 26:2 Error SyntaxError: Unexpected token '}'. */ 56/* @@? 27:1 Error SyntaxError: Unexpected token '}'. */ 57