We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/* @flow */ type T = { foo: string } & { bar: string }; function foo(): T { return { foo: "", bar: "" }; // ok } function bar(x: T): void { (x.foo : string); // ok (x.bar : string); // ok let y: T = x; // ok let z: T = { ...x }; // error }
test.js:3 3: type T = { foo: string } & { bar: string }; ^^^^^^^^^^^^^^^ property `bar`. Property not found in 14: let z: T = { ...x }; // error ^^^^^^^^ object literal. Trace: * path 1: 14: let z: T = { ...x }; // error ^^^^^^^^ MixedT [object literal] 3: type T = { foo: string } & { bar: string }; ^^^^^^^^^^^^^^^ ~> LookupT [property `bar`] (from path 2) * path 2: 14: let z: T = { ...x }; // error ^^^^^^^^ ObjT [object literal] 3: type T = { foo: string } & { bar: string }; ^^^^^^^^^^^^^^^ ~> ObjT [object type] (from path 3) * path 3: 14: let z: T = { ...x }; // error ^^^^^^^^ ObjT [object literal] 14: let z: T = { ...x }; // error ^ ~> IntersectionT [intersection type] (from path 4) * path 4: 14: let z: T = { ...x }; // error ^ ReposUpperT [T] 3: type T = { foo: string } & { bar: string }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ~> IntersectionT [intersection type] (from path 5) * path 5: 14: let z: T = { ...x }; // error ^ ReposUpperT [T] 14: let z: T = { ...x }; // error ^ ~> OpenT [T] (from path 6) * path 6: 14: let z: T = { ...x }; // error ^^^^^^^^ ObjT [object literal] 14: let z: T = { ...x }; // error ^^^^^^^^ ~> OpenT [assignment of var `z`] (from path 7) 14: let z: T = { ...x }; // error ^ ~> AnnotT [T] * path 7: 14: let z: T = { ...x }; // error ^^^^^^^^ ObjT [object literal] 14: let z: T = { ...x }; // error ^^^^^^^^ ~> OpenT [object literal] (from path 8) 14: let z: T = { ...x }; // error ^^^^^^^^ ~> ReposLowerT [assignment of var `z`] * path 8: 3: type T = { foo: string } & { bar: string }; ^^^^^^^^^^^^^^^ ObjT [object type] 14: let z: T = { ...x }; // error ^^^^^^^^ ~> ObjAssignT [object literal] (from path 9) * path 9: 3: type T = { foo: string } & { bar: string }; ^^^^^^^^^^^^^^^ ObjT [object type] 14: let z: T = { ...x }; // error ^ ~> SpeculativeMatchT [intersection: object type] (from path 10) * path 10: 14: let z: T = { ...x }; // error ^ IntersectionT [intersection type] 14: let z: T = { ...x }; // error ^^^^^^^^ ~> ConcreteT [object literal] (from path 11) * path 11: 14: let z: T = { ...x }; // error ^ IntersectionT [intersection type] 14: let z: T = { ...x }; // error ^^^^^^^^ ~> ObjAssignT [object literal] (from path 12) * path 12: 14: let z: T = { ...x }; // error ^ AnnotT [T] 14: let z: T = { ...x }; // error ^^^^^^^^ ~> ObjAssignT [object literal] (from [not shown])
The text was updated successfully, but these errors were encountered:
+1
Sorry, something went wrong.
is this issue being worked on currently?
No branches or pull requests
The text was updated successfully, but these errors were encountered: