• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 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
16declare class A {
17  private constructor()
18  internal constructor(x : int)
19  private foo1() : int
20  internal foo2() : int
21  private get x1() : int
22  internal get x2() : int
23  private set x1(x : int)
24  internal set x2(x : int)
25}
26
27declare class CIterator implements Iterator<string> {
28
29  public ind_: int;
30  public base_: C;
31
32  constructor (base: C)
33
34  override next(): IteratorResult<string>
35}
36
37declare class B {
38  private [Symbol.iterator] () : CIterator;
39}
40
41declare class C {
42  internal [Symbol.iterator] () : CIterator;
43}
44
45declare class D {
46  private [index: number]: number
47}
48
49declare class E {
50  internal [index: number]: number
51}
52
53/* @@? 17:3 Error SyntaxError: Methods or fields should not be decorated with private in ambient class. */
54/* @@? 18:3 Error SyntaxError: Methods or fields should not be decorated with internal in ambient class. */
55/* @@? 19:3 Error SyntaxError: Methods or fields should not be decorated with private in ambient class. */
56/* @@? 20:3 Error SyntaxError: Methods or fields should not be decorated with internal in ambient class. */
57/* @@? 21:3 Error SyntaxError: Methods or fields should not be decorated with private in ambient class. */
58/* @@? 22:3 Error SyntaxError: Methods or fields should not be decorated with internal in ambient class. */
59/* @@? 23:3 Error SyntaxError: Methods or fields should not be decorated with private in ambient class. */
60/* @@? 24:3 Error SyntaxError: Methods or fields should not be decorated with internal in ambient class. */
61/* @@? 38:3 Error SyntaxError: Methods or fields should not be decorated with private in ambient class. */
62/* @@? 42:3 Error SyntaxError: Methods or fields should not be decorated with internal in ambient class. */
63/* @@? 46:3 Error SyntaxError: Methods or fields should not be decorated with private in ambient class. */
64/* @@? 50:3 Error SyntaxError: Methods or fields should not be decorated with internal in ambient class. */