You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When one creates an exact object type, which contains just optional attributes. And later initializes an object using this type, where no attributes are initialized. I expect this to work, as an "empty" object is obviously a subtype of an object with just optional attributes.
`
type T = {|
value?: ?string,
|}
const t:T = {};`
Actual behavior
Flow returns an error on initializing the object: Cannot assign object literal to t because inexact object literal [1] is incompatible with exact T [2]
Flow version: 0.96.2
Expected behavior
When one creates an exact object type, which contains just optional attributes. And later initializes an object using this type, where no attributes are initialized. I expect this to work, as an "empty" object is obviously a subtype of an object with just optional attributes.
`
type T = {|
value?: ?string,
|}
const t:T = {};`
Actual behavior
Flow returns an error on initializing the object: Cannot assign object literal to
t
because inexact object literal [1] is incompatible with exactT
[2]The text was updated successfully, but these errors were encountered: