Ayaz Hafiz
28c3709ddf
Miscellaneous cleanup
2022-11-08 14:11:26 -06:00
Ayaz Hafiz
8dfc9c0367
Inline BadType::BadTypeArguments in canonicalization errors
2022-11-08 14:11:25 -06:00
Ayaz Hafiz
98464984dd
Remove type problem bad type
2022-11-08 14:11:25 -06:00
Ayaz Hafiz
09748aec48
Remove problems from error type API surface
2022-11-08 14:11:25 -06:00
Ayaz Hafiz
c9953129cb
Remove problem storage in Type::Erroneous
2022-11-08 14:11:24 -06:00
Ayaz
8179e29bf8
Merge pull request #4486 from roc-lang/more-prep-constraining
...
Lift constraining expectation indices up a level
2022-11-08 13:47:57 -06:00
Ayaz Hafiz
4e2eb67ff1
Surface constrain_expr takes an index
2022-11-08 09:00:50 -06:00
Anton-4
a6a2b59a79
Merge branch 'main' of github.com:lukewilliamboswell/roc into rust-docs
2022-11-08 15:57:24 +01:00
Luke Boswell
2c2a70b8e7
Merge remote-tracking branch 'upstream/main' into rust-docs
2022-11-06 09:15:57 +11:00
Joshua Warner
5d5b71a083
Refactor several parse methods to use more combinators
2022-11-05 09:44:08 -04:00
Richard Feldman
2110540a53
Merge pull request #4464 from joshuawarner32/fix-one_of
...
Fix one_of bug, properly return MadeProgress from "when" parsing
2022-11-03 19:25:36 -07:00
Joshua Warner
311193fe70
Fix one_of error state handling
2022-11-03 20:54:08 -04:00
Luke Boswell
f3bdb5f321
updating rust package documentation
2022-11-03 20:00:06 +11:00
Ayaz Hafiz
2a4fca7034
First pass at expectations taking a type index
2022-11-02 15:05:22 -05:00
Ayaz Hafiz
666f0f8a52
Simplify constructor recovery
...
This fixes a bug in the list pattern matching code that caused crashes
in the presence of list guards, and simplifies the pattern splitting
algorithm to avoid complexity and allocations. Previously we would place
arguments-to-be-matched of constructors and lists at the front of
specialized rows for exhaustiveness checking, but at the back for
redundancy checking. Now, we always place them at the back - this avoids
needless allocation, and is not any worse, since we can still recover
the non-exhaustive witnesses by looking at the end of a list, instead of
the front.
2022-11-01 17:47:22 -05:00
Ayaz Hafiz
1d73560182
Add some more tests
2022-11-01 12:16:11 -05:00
Ayaz Hafiz
342f9f2e02
Add correct redundancy checking and tests for list patterns
2022-11-01 12:07:00 -05:00
Ayaz Hafiz
17920911e4
Implement list exhaustiveness checking
2022-11-01 12:07:00 -05:00
Ayaz Hafiz
62edf9547e
Better printing of list patterns
2022-11-01 12:07:00 -05:00
Ayaz Hafiz
08d04e8c79
Update reporting tests
2022-11-01 12:06:59 -05:00
Ayaz Hafiz
92a3c48ce5
Implement sketching and pattern specialization for list patterns
2022-11-01 12:06:59 -05:00
Ayaz Hafiz
fbdf76e490
Report type errors in list pattern matches
2022-11-01 12:06:59 -05:00
Ayaz Hafiz
f9cb71fcf7
Report list element pattern type mismatches
2022-11-01 12:06:59 -05:00
Ayaz Hafiz
9ab5d0efb8
Constraining of list patterns
2022-10-31 17:05:08 -05:00
Ayaz Hafiz
7b87d0093e
Update reporting tests
2022-10-31 17:05:08 -05:00
Ayaz Hafiz
058d1f0b5d
Add tests for multiple rest pattern errors
2022-10-31 17:05:07 -05:00
Ayaz Hafiz
b0a8b85de3
Canonicalization of list patterns
2022-10-31 17:04:47 -05:00
Richard Feldman
bc2ec738a0
Merge pull request #4281 from lucacervello/suggest-lambda-operator
...
Add suggest lambda operator instead of when
2022-10-31 10:29:46 -07:00
Ayaz Hafiz
debe6332c5
Support OIOP for type aliases
2022-10-31 09:38:21 -05:00
Ayaz Hafiz
6ee2fb496d
Do not check named arguments in both alias args and real typ
2022-10-31 09:38:21 -05:00
Ayaz Hafiz
cfe7c8e5ef
Warn on the presence of unnecessary wildcards in output positions
2022-10-31 09:38:20 -05:00
Ayaz Hafiz
0707739cfc
Prefer "tags are missing" error messages
2022-10-31 09:37:41 -05:00
Ayaz Hafiz
895bf932db
Decide usages contextually based only on one type at a time
2022-10-31 09:37:40 -05:00
Ayaz Hafiz
34be486a9e
Print wildcard in output position correctly
2022-10-31 09:37:40 -05:00
Ayaz Hafiz
4d48ea7c2f
Materialize extension variable polarity in error type reporting
2022-10-31 09:37:40 -05:00
Ayaz Hafiz
3c15ff4694
Correctly print wildcards as appropriate in error messages
2022-10-31 09:37:39 -05:00
Ayaz Hafiz
89867a4dc5
Add parsing error reporting for list patterns
2022-10-26 18:05:52 -05:00
Ayaz Hafiz
2961d1a8be
Remove redundant reference
2022-10-24 14:00:45 -05:00
Ayaz Hafiz
b1a113e084
Simplify confusing error message
2022-10-24 14:00:45 -05:00
Ayaz Hafiz
c1ca64bbc9
Error messages when multiple ability bounds are missing or incomplete
2022-10-24 14:00:45 -05:00
Ayaz Hafiz
49e19d96e5
Print multiple abilities in error types
2022-10-24 13:59:52 -05:00
Ayaz Hafiz
603160dae3
Report errors for duplicate bound abilities
2022-10-24 13:59:50 -05:00
Ayaz Hafiz
14e0cd1b84
Address syntax error
2022-10-23 20:49:06 -05:00
Ayaz Hafiz
bb8888b115
Make sure we don't report errors for illegal derived bodies, just their decls
2022-10-23 20:48:05 -05:00
Folkert de Vries
be624f8bcb
Merge pull request #4359 from roc-lang/i4313
...
Disallow typing optional fields when required fields are annotated
2022-10-23 01:20:55 +02:00
Ayaz Hafiz
05e8e6de6f
Disallow typing optional fields when required fields are annotated
...
Closes #4313
2022-10-18 15:50:20 -05:00
Luca Cervello
b39f0d98b7
review: use parser suggestion
2022-10-17 18:43:28 +02:00
Ayaz Hafiz
f13c57be8b
Tighten up infinite loop error
2022-10-17 10:02:40 -05:00
Ayaz Hafiz
ecab8fa25a
Make sure self-recursive checks only happen after typechecking
...
Programs like
```
after : ({} -> a), ({} -> b) -> ({} -> b)
fx = after (\{} -> {}) \{} -> if Bool.true then fx {} else {}
```
are legal because they always decay to functions, even if they may not
look like functions syntactically. Rather than using a syntactic check
to check for illegally-recursive functions, we should only perform such
checks after we know the types of values.
Closes #4291
2022-10-17 09:59:32 -05:00
Ayaz Hafiz
20e4295eea
Make sure type variables bound to abilities are instantiated in aliases
...
Closes #4259
2022-10-14 13:56:00 -05:00