flow-runtime
flow-runtime copied to clipboard
Type spread over union type doesn't work
This is a:
- [x] Bug Report
- [ ] Feature Request
- [ ] Question
- [ ] Other
Which concerns:
- [x] flow-runtime
- [x] babel-plugin-flow-runtime
- [ ] flow-runtime-validators
- [ ] flow-runtime-mobx
- [ ] flow-config-parser
- [ ] The documentation website
What is the current behaviour?
A type spread over a union creates invalid code
type C1 = { type: "C1", test1: string };
type C2 = { type: "C2", test2: number }
type Cs = C1 | C2
type Err = { id: number, ...Cs }
console.log(Err.properties);
What is the expected behaviour?
To be consistent with Flow's semantics
Which package versions are you using?
Reproducible on live demo https://codemix.github.io/flow-runtime/#/try