2
流量與確切類型工作正常的情況下以下不相容:對象字面值。不精確類型與確切類型(沒有對象擴散)
type Something={|a: string|};
const x1: Something = {a: '42'}; // Flow is happy
const x2: Something = {}; // Flow correctly detects problem
const x3: Something = {a: '42', b: 42}; // --------||---------
…但是流量也抱怨在以下幾點:
type SomethingEmpty={||};
const x: SomethingEmpty = {};
消息是:
object literal. Inexact type is incompatible with exact type
,因爲沒有傳播使用這是不一樣的情況下this one。
經測試最新的0.57.3
。