• 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
16/* The test code is the lowering result of the code:
17    interface test {
18        testFoo: () => string;
19    }
20
21    function ff(): string {
22        return "1111"
23    }
24
25    class ExpectExtend {
26      public tst: test | null;
27      extendstst() {
28      const tst: test = {
29        testFoo : ff,
30      };
31      this.tst = tst;
32    }
33*/
34
35function ff(): string {
36  return "1111";
37}
38
39interface test {
40  set testFoo(testFoo: (()=> string))
41  get testFoo(): (()=> string)
42}
43
44class ExpectExtend {
45  public tst: test;
46  public extendstst() {
47    const tst: test = {
48      testFoo: ff,
49    };
50    (this).tst = tst;
51  }
52  public constructor(tst: test) {
53    this.tst = tst
54  }
55}
56
57assertEQ(true, true);
58