Lines Matching refs:class

42 In API version 11, ArkTS introduces the concepts of the @Sendable decorator and Sendable class. How…
48 #### Rule 1: A Sendable class can inherit only from another Sendable class.
50 …nario is optimized. When a Sendable class inherits from a variable (even if the variable is assign…
54 class A {} // Sendable class
59 class B extends A {}
62 class C extends a {} // Compilation error: The Sendable class cannot inherit from a variable.
65 Affected scenario: If the Sendable class inherits from a variable (even if the variable is assigned…
69 #### Rule 2: A non-Sendable class can inherit only from another non-Sendable class.
71 If a non-Sendable class inherits from a Sendable class, a compilation error is reported.
75 class A {}
77 class B extends A {} // Compilation error: A non-Sendable class cannot inherit from a Sendable c…
80 Affected scenario: If a non-Sendable class inherits from a Sendable class, the compilation fails af…
84 …3: The template type of a Sendable class, collections.Array, collections.Map, and collections.Set …
86class property, meaning that the Sendable class property can use the template type. The type of th…
90 class B {} // Sendable class
93 class C<T> {
94 …v: T; // Allow the Sendable class property to use the template type. No compilation error is re…
106 class B {} // Non-sendable class
109 class C<T> {}
111 …(); // Compilation error: The template type of the Sendable class in the generic class cannot b…
114 …ndable class property uses the template type, no compilation error is reported. 2. If the template…
118 …## Rule 4: Do not use other decorators (class, property, method, or parameter decorators) for the …
120 When the Sendable class uses other decorators, a compilation error is reported.
133 class A {} // Compilation error: A Sendable class cannot use other decorators.
136 Affected scenario: If the Sendable class uses other decorators, the compilation fails after the cha…
146 class C {}
160 class A {}
163 class B {}