• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
16@Sendable
17class SendableClassA {
18    a: number = 1;
19}
20
21@Sendable
22class SendableClassB {
23    b: SendableClassA = new SendableClassA();
24}
25
26@Sendable
27class SendableClassC {
28    static a: number = 1;
29}
30
31@Sendable
32class SendableClassD {
33    b: number = SendableClassC.a;
34}
35
36@Sendable
37class SendableClassE {
38  static public a: number = 1;
39  f(p: number) {
40    @Sendable
41    class SendableClassF {
42      public b: number = SendableClassE.a;
43    }
44  }
45}
46
47if (true) {
48    @Sendable
49    class SendableClassG {
50        static a: number = 1;
51    }
52
53    @Sendable
54    class SendableClassH {
55        b: SendableClassG = new SendableClassG(); //ERROR
56    }
57}
58
59let a: number = 1
60
61@Sendable
62class SendableClassI {
63    b: number = a; //ERROR
64}
65
66
67@Sendable
68class SendableClassJ {
69    p: number = 1;
70}
71let b:SendableClassJ = new SendableClassJ();
72
73@Sendable
74class SendableClassK {
75    ma: SendableClassJ = b; // ERROR
76}