facebook / facebook/flow

Union speculation error message regression

Open
#7,884 0 comments 0 reactions 0 assignees View on GitHub
bug error messages regression Typing: unions/intersections
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

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]
```

* Link to Try-Flow or Github repo: https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVAXAngBwKZgCCYAvGAN4A+YA1NvgFxgBEUcczYlAvlxdXVx4mzAEYBDAE6ce6KAFcAdgGMMASziKwbOAApxTQgEoK3Oe13lUYMPWEtmqbkdRA

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.