• 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
16class A {
17    public x : int;
18
19    public constructor() {
20        this(5);
21    }
22
23    public constructor(
24        let tuple: {{c.to_type}} = {{caches.value}};
25        let a : A = new A(...tuple);
26        let method_result = A.bar(...tuple);
27    ) {
28        this.x = a;
29    }
30}
31
32/* @@? 23:23 Error TypeError: Only abstract or native methods can't have body. */
33/* @@? 24:9 Error SyntaxError: Parameter declaration should have an explicit type annotation. */
34/* @@? 24:9 Error SyntaxError: Unexpected token, expected ',' or ')'. */
35/* @@? 24:9 Error SyntaxError: Unexpected token 'let'. */
36/* @@? 24:9 Error SyntaxError: Unexpected token, expected an identifier. */
37/* @@? 24:20 Error SyntaxError: Using object literals to declare types in place is not supported. Please declare types and interfaces explicitly! */
38/* @@? 24:21 Error SyntaxError: Unexpected token '{'. */
39/* @@? 24:23 Error SyntaxError: Field type annotation expected. */
40/* @@? 24:23 Error SyntaxError: Unexpected token '.'. */
41/* @@? 24:31 Error SyntaxError: Field type annotation expected. */
42/* @@? 24:34 Error SyntaxError: Unexpected token '='. */
43/* @@? 24:36 Error SyntaxError: Unexpected token '{'. */
44/* @@? 24:38 Error TypeError: Unresolved reference caches */
45/* @@? 25:21 Error TypeError: Expected 0 arguments, got 1. */
46/* @@? 25:21 Error TypeError: No matching construct signature for class_cyclic_constructor.A(...tuple) */
47/* @@? 25:27 Error TypeError: Spread argument cannot be passed for ordinary parameter. */
48/* @@? 25:30 Error TypeError: Unresolved reference tuple */
49/* @@? 26:31 Error TypeError: Property 'bar' does not exist on type 'A' */
50/* @@? 27:5 Error SyntaxError: Unexpected token ')'. */
51/* @@? 27:7 Error SyntaxError: Unexpected token '{'. */
52/* @@? 28:9 Error TypeError: Cannot reference 'this' in this context. */
53/* @@? 28:14 Error TypeError: Property 'x' does not exist on type 'Error' */
54/* @@? 30:1 Error SyntaxError: Unexpected token '}'. */