Reputation: 9370
I have flow code which looks like this. When I flow check
I get an error 1: const docs: Array<LeadDoc> = property docType of LeadDoc. Property not found in
Is this not yet supported in flow?
export interface LeadDoc {
docType(): string;
}
class Foo {
docType(): string {
return 'foo';
}
}
const docs: Array<LeadDoc> = [
Foo,
];
Upvotes: 0
Views: 94
Reputation: 1446
docType
is a property of instances of Foo
, but [Foo]
is the singleton array of the statics of Foo
. [new Foo]
is of the type Array<LeadDoc>
.
Upvotes: 1