Commit Graph

11529 Commits

Author SHA1 Message Date
ayazhafiz
ee34e79790 Include annotation type signatures in Expected struct
To provide better error messages and suggestions related to changing
type annotations, we now pass annotation type signatures all the way
down through the constraint solver. At constraint generation we
associate the type signature with a unique variable, and during error
reporting, we pull out an `ErrorType` corresponding to the original type
signature, by looking up the unique variable. This gives us two nice
things:

1. It means we don't have to pass the original, AST-like type
   annotation, which can be quite large, to everyone who looks at an
   expectation.
2. It gives us a translation from a `Type` to an `ErrorType` for free
   using the existing translation procedure in `roc_types::subs`,
   without having to create a new translation function.
2021-11-25 11:16:17 -05:00
ayazhafiz
8726e38dad Improve error message when nested wildcards are connected
We now push analysis of when two wildcards are associated with each
other to the time when we try to give tips for a diff between types. Two
wildcards always have a diff, since they are associated with different
types.
2021-11-25 11:15:31 -05:00
ayazhafiz
817bb22f9e Improve error message when we try to unify two wildcards
Closes #1931
2021-11-25 11:15:31 -05:00
ayazhafiz
8f1878bc42 Print type annotation in all type errors related to annotations 2021-11-25 11:15:31 -05:00
ayazhafiz
62873fed81 Propogate original annotation region down in AnnotationSource
This makes it easier for error reporting to find the relevant
annotations that were part of a type error, and display that in the
error message presented to a user.
2021-11-25 11:15:31 -05:00
ayazhafiz
7a0ecbd262 Fix grammar issue in rigids type annotation tip 2021-11-25 11:15:31 -05:00
ayazhafiz
d47c52c422 Fix grammar in comment 2021-11-25 11:15:31 -05:00
Joshua Warner
f4e29bd267
Merge pull request #2069 from rtfeldman/joshuawarner32/impl-app-header-formatting
Implement [more] app header formatting
2021-11-25 07:24:06 -08:00
Richard Feldman
e63727fee4
Merge pull request #2059 from rtfeldman/readme-code-starting-points
Add a list of starting points to get familiar with compiler code
2021-11-25 00:12:46 -05:00
Richard Feldman
8e72fa00fa
Merge pull request #2072 from rtfeldman/optimize-deep-copy-var
Optimize deep copy var
2021-11-24 23:39:24 -05:00
Richard Feldman
ea4a88b697
Merge pull request #2073 from rtfeldman/closure-tag-type
solve.rs improvements
2021-11-24 23:28:16 -05:00
Richard Feldman
c02d39b019
Merge pull request #2074 from rtfeldman/tag-name-dedup
deduplicate tag names
2021-11-24 23:19:25 -05:00
Richard Feldman
618925fe27
Fix typo in comment 2021-11-24 23:17:24 -05:00
Folkert
093b733a2c add tag name dedup 2021-11-25 00:11:11 +01:00
Folkert
3139e73cf9 optimize non-capturing closure type 2021-11-24 23:14:53 +01:00
Folkert
7c2e8cd812 optimize NAT 2021-11-24 23:00:03 +01:00
Folkert
9c551a0276 use insertion sort 2021-11-24 22:55:45 +01:00
Folkert
51c61ea449 fix number hierarchy 2021-11-24 22:39:58 +01:00
Folkert
e0d7c54906 simplify alias insertion 2021-11-24 22:39:42 +01:00
Folkert
4e4f827bb0 simplify function-or-tag-union insertion 2021-11-24 22:11:05 +01:00
Folkert
379abeed26 refactor tag insertion 2021-11-24 21:57:19 +01:00
Folkert
340055fca5 point to empty VariableSubsSlice 2021-11-24 21:57:00 +01:00
Folkert
3abdfce735 sort tags in builtin aliases 2021-11-24 21:16:04 +01:00
Folkert
cb8e9acb92 special-case the closure tags 2021-11-24 21:14:58 +01:00
Folkert
3e640f78bf cleanup 2021-11-24 20:44:51 +01:00
Folkert
308b91153e add faster insertion path for tag unions 2021-11-24 20:38:52 +01:00
Folkert
541dd9777a thread_local experiment 2021-11-24 19:59:53 +01:00
Folkert
f1541d56bd use Entry in some places 2021-11-24 19:45:30 +01:00
Folkert
5e76e3a97e more reserving into subs 2021-11-24 19:14:37 +01:00
Folkert
5663248a41 docs 2021-11-24 18:59:49 +01:00
Folkert
739ae60b1e clean up usage of reserve_into_subs 2021-11-24 18:52:22 +01:00
Folkert
61f6687dea fix using the wrong length 2021-11-24 18:50:47 +01:00
Folkert
1fbd2a7e7b reserve variable slices 2021-11-24 16:02:55 +01:00
Folkert
a0c9270124 keep track of visited variables in deep_copy_var 2021-11-24 15:14:17 +01:00
Richard Feldman
0c66433373
Merge pull request #2060 from rtfeldman/nightly_examples
Docs: running nightly examples
2021-11-24 08:30:35 -05:00
Folkert de Vries
816e390e36
Merge pull request #2057 from rtfeldman/reporting-cfg-windows
Use cfg to check if we're compiling for windows (in reporting)
2021-11-24 13:29:48 +01:00
satotake
10afadd810 Merge branch 'trunk' into dev-backend-num-is-zero 2021-11-24 10:59:42 +00:00
satotake
7429b09af3 free symbol
rename function
2021-11-24 10:58:51 +00:00
Joshua Warner
24f7692a73 Implement [more] app header formatting
Also, refactor out a utility method to format a Collection. This method can currently
replace some of the formatting done in module headers - but the goal is eventually
to be able to replace the code in fmt_list as well, such that there is 'one true way'
to format collections.
2021-11-23 12:19:43 -08:00
Lucas
f02ed47f31
Merge pull request #2016 from rtfeldman/aarch64_packed_structs
Packed Structs
2021-11-23 14:39:02 -05:00
Folkert
8ce195998a clean up comment 2021-11-23 20:05:11 +01:00
rvcas
8ee01d6ce8 fix: add some checks due to potential truncation issues 2021-11-23 14:03:56 -05:00
Anton-4
712d135230 simplified examples instructions 2021-11-23 19:45:12 +01:00
Richard Feldman
651cb222a7
Drop mention of Interpreted Mode 2021-11-23 13:13:17 -05:00
Richard Feldman
7c39b087b0
Merge pull request #2066 from rtfeldman/joshuawarner32/roc-format-cmd
Implement 'roc format <dir_or_files>' command
2021-11-23 13:09:08 -05:00
Brian Carroll
44cf238a67
Merge pull request #2056 from rtfeldman/wasm-dec-add
Wasm dec add
2021-11-23 13:37:04 +00:00
Folkert de Vries
902796864a
Merge pull request #2067 from rtfeldman/wasm-reduce-recursion
Wasm reduce recursion for Let statements
2021-11-23 12:00:08 +01:00
Folkert
4e6568016d fix comment: rust thought it was code it should execute 2021-11-23 11:56:33 +01:00
Anton-4
886592461e Merge branch 'nightly_examples' of github.com:rtfeldman/roc into nightly_examples 2021-11-23 11:41:23 +01:00
Anton-4
4b9574a87e apply review fixes 2021-11-23 11:40:49 +01:00