如何让流程正确检查类型正在实现的接口?
How do I get flow to correctly check the interface being implemented by a type?
我有如下所示的流程代码。当我 flow check
我得到一个错误 1: const docs: Array<LeadDoc> = property docType of LeadDoc. Property not found in
流中还不支持这个吗?
export interface LeadDoc {
docType(): string;
}
class Foo {
docType(): string {
return 'foo';
}
}
const docs: Array<LeadDoc> = [
Foo,
];
docType
是 Foo
的 实例 的 属性,但 [Foo]
是 [= Foo
的 18=] 统计。 [new Foo]
属于 Array<LeadDoc>
.
类型
我有如下所示的流程代码。当我 flow check
我得到一个错误 1: const docs: Array<LeadDoc> = property docType of LeadDoc. Property not found in
流中还不支持这个吗?
export interface LeadDoc {
docType(): string;
}
class Foo {
docType(): string {
return 'foo';
}
}
const docs: Array<LeadDoc> = [
Foo,
];
docType
是 Foo
的 实例 的 属性,但 [Foo]
是 [= Foo
的 18=] 统计。 [new Foo]
属于 Array<LeadDoc>
.