Skip to content
New issue

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

Type spread over union type doesn't work #203

Open
3 of 10 tasks
EXio4 opened this issue Apr 14, 2018 · 0 comments
Open
3 of 10 tasks

Type spread over union type doesn't work #203

EXio4 opened this issue Apr 14, 2018 · 0 comments

Comments

@EXio4
Copy link

EXio4 commented Apr 14, 2018

This is a:

  • Bug Report
  • Feature Request
  • Question
  • Other

Which concerns:

  • flow-runtime
  • 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

Try Flow example


Which package versions are you using?

Reproducible on live demo https://codemix.github.io/flow-runtime/#/try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant