Flow中的交集类型给出了奇怪的错误

时间:2017-07-13 08:19:15

标签: javascript ecmascript-6 flowtype

我在Flow中定义了以下类型:

export type MovementInfo = { id: string, x: number, y: number, s: [number, number] }
export type TypeInfo = { eType: string, idx: number }
export type CreationInfo = TypeInfo & MovementInfo
export type CmdNew = { type: 'new' } & CreationInfo

在VSCode Flow中,在第3行和TypeInfo中为MovementInfo{ type: 'new' }加下划线  4,并给我以下错误:

[flow] object type (This type is incompatible with an implicitly-returned undefined.)

使用Flow 0.49.1

是我还是Flow做一些蠢事?

0 个答案:

没有答案