1/* 2 * Copyright (c) 2024 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 A1 { 17 private bSource: byte = 0 as byte 18 private sSource: short = 1 as short 19 private iSource: int = 2 as int 20 private lSource: long = 3 as long 21 private fSource: float = 4 as float 22 private cSource: char = 5 as char 23 public blTarget: long = this.bSource 24 public bfTarget: float = this.bSource 25 public bdTarget: double = this.bSource 26 public slTarget: long = this.sSource 27 public sfTarget: float = this.sSource 28 public sdTarget: double = this.sSource 29 public ilTarget: long = this.iSource 30 public ifTarget: float = this.iSource 31 public idTarget: double = this.iSource 32 public lfTarget: float = this.lSource 33 public ldTarget: double = this.lSource 34 public fdTarget: double = this.fSource 35 public clTarget: long = this.cSource 36 public cfTarget: float = this.cSource 37 public cdTarget: double = this.cSource 38} 39 40function main(): void { 41 let a1: A1 = new A1() 42 assert (a1.blTarget == 0) 43 assert (a1.bfTarget == 0.0) 44 assert (a1.bdTarget == 0.0) 45 assert (a1.slTarget == 1) 46 assert (a1.sfTarget == 1.0) 47 assert (a1.sdTarget == 1.0) 48 assert (a1.ilTarget == 2) 49 assert (a1.ifTarget == 2.0) 50 assert (a1.idTarget == 2) 51 assert (a1.lfTarget == 3.0) 52 assert (a1.ldTarget == 3.0) 53 assert (a1.fdTarget == 4.0) 54 assert (a1.clTarget == 5) 55 assert (a1.cfTarget == 5.0) 56 assert (a1.cdTarget == 5.0) 57} 58