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

Using intersected types in $Diff throws error #8050

Open
schneckentempo opened this issue Aug 29, 2019 · 0 comments
Open

Using intersected types in $Diff throws error #8050

schneckentempo opened this issue Aug 29, 2019 · 0 comments

Comments

@schneckentempo
Copy link

schneckentempo commented Aug 29, 2019

Flow version: v0.106.2 and older

Expected behavior

I would expect $Diff to work with multiple type intersections

Actual behavior

$Diff seems to only take one intersection (level) from the top of the tree into account and forgets following intersections

type A = { a: string }
type B = A & { b: string }
type C = B & { c?: string }

const test: $Diff<C, { b: string }> = { a: 'a', c: 'c' }

const c = test.c

is a minimal example which leads to the error
image

@schneckentempo schneckentempo changed the title Using interesected types in $Diff throws error Using intersected types in $Diff throws error Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants