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

Union speculation error message regression #7884

Open
goodmind opened this issue Jul 3, 2019 · 0 comments
Open

Union speculation error message regression #7884

goodmind opened this issue Jul 3, 2019 · 0 comments
Labels
bug error messages regression Seems to have worked before, but is broken now (issue has mention of last working version) Typing: unions/intersections

Comments

@goodmind
Copy link
Contributor

goodmind commented Jul 3, 2019

Regression in Flow v0.68

Flow version: 0.102.0

Expected behavior

7: foo({       
  ^ Cannot call `foo` with object literal bound to `a` because: 
  Either string [1] is incompatible with string literal `foo` [2] in property `type`. 
  Or string [1] is incompatible with string literal `bar` [3] in property `type`.
References:
8:   type: ""           ^ [1]
3: type A = {| +type: "foo" |} | {| +type: "bar" |}
                      ^ [2]
3: type A = {| +type: "foo" |} | {| +type: "bar" |}
                                           ^ [3]

Actual behavior

7: foo({       
^ Cannot call `foo` with object literal bound to `a` because object literal [1] is incompatible with `A` [2].
References:
7: foo({       
^ [1]
5: function foo(a: A) {}
                   ^ [2]
@goodmind goodmind added bug Typing: unions/intersections regression Seems to have worked before, but is broken now (issue has mention of last working version) needs triage error messages and removed needs triage labels Jul 3, 2019
@goodmind goodmind changed the title Union speculation error regression Union speculation error message regression Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug error messages regression Seems to have worked before, but is broken now (issue has mention of last working version) Typing: unions/intersections
Projects
None yet
Development

No branches or pull requests

1 participant