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
It is my understanding that an intersection (&) of two objects is equivalent to merging type declarations of those objects. So in the example below types A and B should be identical. As the test demonstrates, they are not.
/* @flow */
type A = {x: number} & {y: number};
type B = {x: number, y: number};
function test (a: A, b: B) {
(a: B); // Flow error
(b: A); // ok
}
The text was updated successfully, but these errors were encountered:
Thanks, @pasha-mf. Merging this into the issue I created. @sterpe, creating a separate issue for object/array intersection types. Going to track everything intersection related in a new meta-issue.
It is my understanding that an intersection (
&
) of two objects is equivalent to merging type declarations of those objects. So in the example below typesA
andB
should be identical. As the test demonstrates, they are not.The text was updated successfully, but these errors were encountered: