• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-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 intParam(a: int): int {
17    return 0;
18}
19
20function objParam(a: Object): int {
21    return 2;
22}
23
24function retRefInt(a: int): Int {
25    return new Int(a);
26}
27
28function retInt(a: Int): int {
29    return a;
30}
31
32function main(): void {
33    let a: int = 1;
34    let b: Int = 2;
35    let c: Int = intParam(a);
36    assertEQ(c, 0)
37    let f: Int = intParam(b);
38    assertEQ(f, 0)
39    let g: int = objParam(a);
40    assertEQ(g, 2)
41    let h: int = objParam(b);
42    assertEQ(h, 2)
43    let i: Object = b;
44    let j: int = retInt(retRefInt(5));
45    assertEQ(j, 5)
46}
47