• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 */
15class A_class{
16    localfield:string = "localstring";
17    foo(){
18        abstract class AbstractLocalClass{}
19        class LocalClass extends AbstractLocalClass{
20            method1():string{
21                return localfield;
22            }
23        }
24        final class FinalLocalClass{
25            method1():string{
26                return this.localfield;
27            }
28        }
29
30        class ExtendsLocalClass extends FinalLocalClass{}
31        abstract final class AbstractFinalLocalClass{}
32
33        abstract class AbstractLocalClass2{
34            method1(){}
35        }
36        let a:AbstractLocalClass2 = new AbstractLocalClass2();
37
38        abstract class AbstractLocalClass3{
39            abstract override method1()
40            abstract method2(){}
41        }
42
43        final class FinalLocalClass2 extends AbstractLocalClass3{
44            override method2(){}
45            abstract method3()
46        }
47
48
49    }
50}
51
52/* @@? 18:18 Error SyntaxError: Illegal start of CLASS expression. */
53/* @@? 19:9 Error SyntaxError: Illegal start of CLASS expression. */
54/* @@? 24:15 Error SyntaxError: Illegal start of CLASS expression. */
55/* @@? 30:9 Error SyntaxError: Illegal start of CLASS expression. */
56/* @@? 31:24 Error SyntaxError: Illegal start of CLASS expression. */
57/* @@? 33:18 Error SyntaxError: Illegal start of CLASS expression. */
58/* @@? 36:15 Error TypeError: Cannot find type 'AbstractLocalClass2'. */
59/* @@? 36:41 Error TypeError: Cannot find type 'AbstractLocalClass2'. */
60/* @@? 38:18 Error SyntaxError: Illegal start of CLASS expression. */
61/* @@? 43:15 Error SyntaxError: Illegal start of CLASS expression. */
62