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 16enum Color{RED, BLUE, GREEN} 17 18@Retention("SOURCE") 19@interface Anno{} 20 21@Retention("SOURCE") 22@interface ClassAuthor { 23 authorName: string = "Jim" 24 authorAge: number = -35 25 testBool: boolean = false 26 favorColor: Color = Color.BLUE 27 color: FixedArray<Color> = [Color.RED, Color.BLUE] 28 reviewers: FixedArray<string> = ["Bob", "Jim", "Tom"] 29 reviewersAge: FixedArray<number> = [18, 21, 32] 30 testBools: FixedArray<boolean> = [false, true, false] 31 mutiArray: FixedArray<FixedArray<number>> = [ 32 [1, 2, 3], 33 [4, +5, 6], 34 [7, 8, -9] 35 ] 36} 37 38@Anno 39@ClassAuthor 40namespace A{ 41 @Anno 42 @ClassAuthor 43 let a = 1 44 45 @Anno 46 @ClassAuthor 47 function foo(@Anno a:int){} 48 49 @Anno 50 @ClassAuthor 51 interface MyInterface{ 52 @Anno 53 @ClassAuthor 54 value:string 55 56 @Anno 57 @ClassAuthor 58 bar(){} 59 } 60 61 @Anno 62 @ClassAuthor 63 class A{ 64 @Anno 65 @ClassAuthor 66 b:number = 1 67 68 @Anno 69 @ClassAuthor 70 foo(){} 71 } 72} 73 74function main(){}