Commit afac86e
Print unresolved types as _
Summary:
If we can't resolve a type variable, display it as "_" rather than "[unresolved]". This makes type errors easier to read.
For example, if a user writes `await 1` we used to show:
```
-> Expected Awaitable<[unresolved]>
-> But got int
```
The problem isn't that we couldn't find an inner type for `Awaitable`. The problem is that `1` isn't an awaitable value at all! We now show this:
```
-> Expected Awaitable<_>
-> But got int
```
This is much easier to read, especially in larger types. It's also consistent with `Terr`.
Reviewed By: hgoldstein
Differential Revision: D39067882
fbshipit-source-id: 0e758cf36fe9c73f3b6347d7f53572fabeadeca31 parent 68b0b52 commit afac86e
File tree
104 files changed
+258
-258
lines changed- hphp/hack
- src/typing
- test
- decl
- error_formatting_highlighted
- sound_dynamic/typing
- typecheck
- akempty
- argument_unpacking
- array/safe_vector_array
- await_as_an_expression/error
- await_precedence
- strong_precedence
- weak_precedence
- concurrent/error
- control_flow
- dynamic
- enum_class_label
- explicit_type_collection
- expression_trees_not_virtualize_functions
- expression_trees
- ffp
- invalid_arraykey
- lambda
- variadics
- method_call_inference
- new_inference
- eager_solve
- oldtypehole
- typehole
- untypeable
- nonnull
- re_prefixed_string
- reified_generics
- type_structure
- union
- yield
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
104 files changed
+258
-258
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
656 | | - | |
| 656 | + | |
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments