• 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
16interface Person {
17  cb: () => void
18}
19
20class student implements Person{
21  cb() {}
22}
23
24interface I {
25  cb: () => void
26  cb2(): void;
27}
28
29class C implements I {
30    cb() {} // Should report error
31    cb2: () => void = () => {} // Should report error
32}
33
34class A {
35    cb(): void {}
36}
37
38class B extends A {
39    cb: () => void = () => {} // Should report error
40}
41
42interface Person7 {
43  fun: () => void
44}
45
46interface Person7_1 extends Person7 {
47  fun():void
48}
49
50interface Person8 {
51  fun():void
52}
53
54interface Person8_1 extends Person8 {
55  fun: () => void
56}
57
58interface Person9<T> {
59  fun: () => void
60}
61
62interface Person9_1<T> extends Person9<T> {
63  fun():void
64}