Richard Feldman
99f55d6ed6
Merge remote-tracking branch 'origin/main' into https-packages
2022-11-24 19:14:31 -05:00
Ayaz Hafiz
e2b30e5301
Constrain + solve crash
2022-11-24 14:46:50 -06:00
Ayaz Hafiz
9dc489c2b0
First pass constraining crash
2022-11-24 14:46:49 -06:00
Ayaz
848c18f996
Merge pull request #4567 from joshuawarner32/tuple-type-annotation
...
Implement tuple type parsing
2022-11-24 14:42:11 -06:00
Richard Feldman
b9b03d432a
Merge remote-tracking branch 'origin/main' into https-packages
2022-11-24 13:14:36 -05:00
Richard Feldman
ed0c64ca7c
Fix reporting tests
2022-11-24 11:54:51 -05:00
Joshua Warner
c6b5273144
Implement tuple type parsing
...
Also change some tests with newly relaxed indentation requirements, and remove an irrelevant test (since unindented close parens are now perfectly valid, the test is no longer useful).
2022-11-24 07:36:59 -08:00
Ayaz Hafiz
f8d51473d8
Report builtins type errors during load building as appropriate
2022-11-24 10:05:25 -05:00
Richard Feldman
f5cb2d73a1
Merge branch 'precompiled-legacy' into https-packages
2022-11-24 04:29:56 -05:00
Ayaz Hafiz
7c3a0807c2
Suggest binding type variables to an ability when they're unsatisfied
2022-11-23 16:37:50 -06:00
Folkert
1875176319
improve formatting
2022-11-23 23:16:37 +01:00
Folkert
e44a8a9eed
print all the relevant info
2022-11-23 22:58:58 +01:00
Folkert
e7f3c6f281
inline dbg
2022-11-23 21:23:28 +01:00
Ayaz Hafiz
03e6d6d7e0
Report builtins type errors during load building as appropriate
2022-11-22 10:36:41 -06:00
Richard Feldman
721841fa1f
Provide roc_cache_dir everywhere
2022-11-20 19:53:48 -05:00
Ayaz
1a3119e4c5
Merge pull request #4525 from roc-lang/fix-fixpoints-2
...
Implement fixpoint-fixing and unconditionally emplace variables into type indices
2022-11-19 17:47:02 -06:00
Joshua Warner
2d9aba2242
Refactor parser methods to not return State as part of ParseError
...
As previously discovered with #4464 , it's easy to accidentally mis-use the State value returned on the Err path.
There were mixed assumptions about what that State represents: (1) the State where the error occurred, or (2) the State at the beginning of the thing we were just parsing.
I fixed this up to always mean (2) - at which point we don't actually need to return the State at all - so it's impossible for further discrepency to creep in.
I also took the liberty to refactor a few more methods to be purely combinator-based, rather than calling `parse` directly.
2022-11-18 19:52:23 -05:00
Richard Feldman
a8ee5b7cbf
Merge pull request #4537 from roc-lang/output-tweaks
...
Reporting tweaks
2022-11-17 08:28:57 -05:00
Richard Feldman
6c4e2c8738
Revise wording on unnecessary wildcard warning
...
My concern with the previous wording is that:
- Beginners will be confused by "these are always open"
- Users advanced enough to understand what that actually means won't benefit from seeing it in this warning message!
2022-11-16 23:18:51 -05:00
Richard Feldman
2f54e46909
Add a blank line after failed inline expectations
2022-11-16 23:11:05 -05:00
Richard Feldman
1e4cf52fd4
Merge pull request #4504 from roc-lang/fix-styles
...
Fix some web styles
2022-11-16 21:53:05 -05:00
Ayaz Hafiz
fe0eacb70a
Propogate only_unseen phanton type count check
2022-11-16 19:46:54 -06:00
Ayaz Hafiz
28768bcfba
Fix order of alias arg discovery
2022-11-16 14:05:53 -06:00
Ayaz Hafiz
cc677917a7
Fix typo
2022-11-16 14:05:53 -06:00
Ayaz Hafiz
216a786d52
Make sure to count generated phantom type variables in error type
2022-11-16 14:05:53 -06:00
Ayaz Hafiz
2a5864c19a
Update reporting tests
2022-11-16 14:05:52 -06:00
Folkert de Vries
de472015f6
Merge pull request #4505 from roc-lang/fix-web-repl-palette
...
Fix web REPL error formatting by routing the active Palette everywhere
2022-11-15 15:49:37 +01:00
Joshua Warner
ca5d084497
Implement tuple pattern parsing
...
Step 2 of N in implementing #4465
2022-11-13 16:11:57 -05:00
Folkert
662bf1de99
more workspace dependencies
2022-11-13 16:10:02 +01:00
Brian Carroll
ed048c7c93
Fix more tests
2022-11-12 09:12:28 +00:00
Ayaz Hafiz
bd9c9cc184
Replace busted gen test with reporting test
2022-11-11 21:16:26 -06:00
Ayaz Hafiz
ae6f349669
Update reporting test
2022-11-11 21:16:26 -06:00
Ayaz Hafiz
f1180a1549
Byte deletion party
2022-11-11 21:16:23 -06:00
Ayaz Hafiz
a2e90c3709
Fix types SoA usage in solve
2022-11-11 21:16:23 -06:00
Ayaz Hafiz
e3ef9828c7
Store solve aliases as TypeTag
2022-11-11 21:16:05 -06:00
Ayaz Hafiz
314b75b0e5
Feed SoA Types from load into solve
2022-11-11 21:16:03 -06:00
Richard Feldman
83e4eef475
Merge pull request #4492 from joshuawarner32/tuple-syntax-1
...
Implement initial tuple syntax
2022-11-11 17:55:25 -08:00
Brian Carroll
b64514d7e4
Fix web REPL error formatting by routing the active Palette everywhere
2022-11-11 23:38:08 +00:00
Richard Feldman
1478cfc3ad
Don't use style attributes for web repl colors
...
This doesn't work because of our content-security policy!
2022-11-11 12:24:43 -05:00
Joshua Warner
1753c9cf5b
Implement initial tuple syntax
2022-11-08 18:04:46 -05:00
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
Ayaz Hafiz
6149c289fc
Update Eq symbols
2022-10-12 16:38:36 -05:00
Ayaz Hafiz
ce2760d96d
Some more reporting tests for Eq
2022-10-12 16:38:36 -05:00
Ayaz Hafiz
99f097ddb5
Improve error messages for abilities
2022-10-12 16:38:35 -05:00
Ayaz Hafiz
b6ffd09adf
Update reporting tests
2022-10-12 16:37:50 -05:00
Ayaz Hafiz
0045c16b3e
Improve notes on underivable abilities
2022-10-12 16:37:49 -05:00
Ayaz Hafiz
b587bcf0c2
Implement obligation checking for the Eq
ability
...
Every type can have `Eq.isEq` derived for it, as long as
- it does not transitively contain a function
- it does not transitively contain a floating point value
- it does not transitively contain an opaque type that does not support
`Eq`
2022-10-12 16:37:49 -05:00
Christopher Duncan
d7cdcfc66b
Fix typo in error
2022-10-12 08:26:33 -04:00
Luca Cervello
1c0b1ba0af
feat: suggest lambda operator
2022-10-10 12:43:38 +02:00
Joshua Warner
ab4e03b05d
Rename Lambda -> Closure for consistency
2022-10-08 11:05:05 -07:00
Ayaz Hafiz
9d91b9bc5a
Add reporting case for inferred char range type mismatch
2022-10-05 17:28:01 -05:00
Ayaz Hafiz
178b634266
Treat single quote literals as ranged numbers for inference purposes
2022-10-05 17:28:00 -05:00
Ayaz
a08b45263b
Merge branch 'main' into shift-signature
...
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
2022-10-04 12:58:09 -05:00
Ayaz Hafiz
dea7661068
Have Num.shift*By
functions shift by a U8
...
https://roc.zulipchat.com/#narrow/stream/231635-compiler-development/topic/casual.20conversation/near/302305020
2022-10-04 12:28:33 -05:00
Ayaz Hafiz
5c6856d1d6
Add reporting test
2022-10-04 11:10:11 -05:00
Ayaz Hafiz
e9efc95425
Obligation checking for the Hash
ability
...
This implements type-level checks that types can and cannot implement
the `Hash` ability.
Part of #4195
2022-10-04 10:51:14 -05:00
Ayaz Hafiz
eadbc0912a
Update the compiler to be aware of Hash
2022-10-04 10:22:22 -05:00
Ayaz
f145610be0
Merge pull request #4125 from roc-lang/fix-module-name-mismatches
...
Assorted QoL improvements to incorrect module importing
2022-10-04 06:37:19 -05:00
Ayaz Hafiz
cf5712620c
Suggest Bool.true and Bool.false where tag literals are used
...
Closes #4147
2022-10-03 17:36:27 -05:00
Ayaz Hafiz
581eeb5054
Improve invalid recursion error message quality
2022-10-03 13:30:43 -05:00
Ayaz Hafiz
92b754f292
Illegal self recursion on toplevel defs
...
Closes #4153
2022-10-03 13:14:56 -05:00
Ayaz Hafiz
fd4b20de58
Fix test
...
Closes #3385
2022-10-03 13:03:52 -05:00
Ayaz Hafiz
0cc9ea4b05
Detect and report module names that don't match what they are used as
...
Prior to this commit, if you had a module structure like
```
| - A.roc
| - Dep
| - B.roc
```
where `B.roc` was defined as
```
interface B exposes [] imports []
```
and `A.roc` was defined as
```
interface A exposes [] imports [Dep.B]
```
The compiler would hang on you. The reason is that even though we expect
`B` to be named `Dep.B` relative to `A`, that would not be enforced.
With this patch, we now enforce such naming schemes - a module must have
the namespaced name it is referenced by. Currently, we determine the
expected namespaced name by looking at how transitive dependencies of the
root module reference the module. In the future, once we have a package
ecosystem and a solid idea of "package roots", we can use the "package
root" to determine how a module should be named.
Closes #4094
2022-10-02 21:38:03 -05:00
Ayaz Hafiz
c67be21636
Check that module names correspond to the paths they are defined in
...
Closes #3440
Closes #4050
2022-10-02 21:38:02 -05:00
Ayaz Hafiz
985da70343
Add tests to ignore for now
2022-09-30 13:40:34 -05:00
Ayaz Hafiz
92aa0912ea
Report unused imports in modules
2022-09-30 13:40:34 -05:00
Ayaz Hafiz
5dc51ce444
Add unnecessary import test cases
2022-09-30 13:40:34 -05:00
Ayaz Hafiz
5f117be306
Improve error message when shadowing builtin type
...
Closes #3109
2022-09-30 13:40:34 -05:00
Tim Whiting
ab000a5b49
Update error text
...
fix error text
2022-09-30 07:36:24 -06:00
Tim Whiting
f323fe6534
fix expression indentation error
2022-09-28 20:11:24 -06:00
dependabot[bot]
49dd5af13d
Bump insta from 1.19.0 to 1.20.0
...
Bumps [insta](https://github.com/mitsuhiko/insta ) from 1.19.0 to 1.20.0.
- [Release notes](https://github.com/mitsuhiko/insta/releases )
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md )
- [Commits](https://github.com/mitsuhiko/insta/compare/1.19.0...1.20.0 )
---
updated-dependencies:
- dependency-name: insta
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-26 07:14:24 +00:00
Ayaz Hafiz
06bef34829
Import Decode by default in all modules
2022-09-21 12:29:07 -05:00
Ayaz Hafiz
1de37f042e
Update reporting tests
2022-09-21 12:29:06 -05:00
Ayaz
211c297230
Merge pull request #4041 from KilianVounckx/opaque-bool
...
Opaque bool
2022-09-21 11:15:41 -05:00
Ayaz
362dadc7e9
Merge pull request #4073 from roc-lang/i4068
...
Construct exhaustiveness branches with condition, not branch, variable
2022-09-20 17:03:33 -05:00
Ayaz Hafiz
c430939432
Fix reporting tests
2022-09-20 15:51:04 -05:00
Ayaz Hafiz
10dffe8691
Unused import
2022-09-20 14:42:09 -05:00
Ayaz Hafiz
3d4313efbf
Update reporting tests
2022-09-20 14:42:09 -05:00
kilianv
9a168ecba3
Change error reporting for bools
2022-09-20 14:42:02 -05:00
Richard Feldman
a237c5c0fb
Merge pull request #4071 from roc-lang/cli-program
...
Program.roc in CLI platform
2022-09-20 07:11:38 -07:00
Ayaz Hafiz
1799d6ed0e
Construct exhaustiveness branches with condition, not branch, variable
...
Previously we would construct the shapes of unions used in the pattern
tree for exhaustiveness checking using the type of the branch patterns,
rather than the type of the condition variable. Clearly we want to
always use the condition variable, otherwise some branches will be
seen as exhaustive, when they are not!
To do this, we now index into the condition variable while refying the
patterns to build the tree for exhaustiveness checking.
Closes #4068
2022-09-19 13:37:59 -05:00
Ayaz Hafiz
0f0e414272
Improve error message for uninhabited patterns
2022-09-19 10:55:02 -05:00
Ayaz Hafiz
147636f42b
Base reported row numbers on original rows, not reified rows
2022-09-19 10:47:35 -05:00
Ayaz Hafiz
041b91e031
Add more test cases
2022-09-19 10:45:31 -05:00
Richard Feldman
88ab511687
Report canonicalization errors on opaque names
2022-09-19 09:20:51 -04:00
Ayaz Hafiz
ac752adc7c
Check in some more work
2022-09-16 16:09:21 -05:00
Ayaz Hafiz
6adb88beee
Report uninhabited branches as redundant
2022-09-16 15:55:46 -05:00
Ayaz Hafiz
1d7aef8c96
Don't include uninhabited constructors in exhaustiveness checking
2022-09-16 15:36:54 -05:00
Ayaz Hafiz
42633c1f96
Span body of last branch in exhaustiveness checking
...
Closes #4028
2022-09-13 16:24:59 -04:00
dependabot[bot]
0079048944
Bump bumpalo from 3.10.0 to 3.11.0
...
Bumps [bumpalo](https://github.com/fitzgen/bumpalo ) from 3.10.0 to 3.11.0.
- [Release notes](https://github.com/fitzgen/bumpalo/releases )
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md )
- [Commits](https://github.com/fitzgen/bumpalo/compare/3.10.0...3.11.0 )
---
updated-dependencies:
- dependency-name: bumpalo
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 21:08:56 +00:00
dependabot[bot]
d1c406812f
Bump pretty_assertions from 1.2.1 to 1.3.0
...
Bumps [pretty_assertions](https://github.com/rust-pretty-assertions/rust-pretty-assertions ) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/rust-pretty-assertions/rust-pretty-assertions/releases )
- [Changelog](https://github.com/rust-pretty-assertions/rust-pretty-assertions/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rust-pretty-assertions/rust-pretty-assertions/compare/v1.2.1...v1.3.0 )
---
updated-dependencies:
- dependency-name: pretty_assertions
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 05:28:00 +00:00
Jan Van Bruggen
431455dd1b
Rephrase web/terminal-related "platform" to "environment"
2022-09-11 10:25:02 -06:00
Ayaz Hafiz
c2452ff751
Lose rigidity of annotated optional fields before generalization
...
We have this idea of "rigid optional" fields to annotate record fields
that must necessarily be optional. That avoids the admission of programs
we cannot faithfully compile, like
```
f : {a: Str, b ? U64}
f = {a: "b", b: 1}
```
We want to lose the rigidity restriction when a generalized symbol is
used as at a specialized site; for example it should be possible to call
`f : {x ? Str} -> {}` with both `{}` and `{x : Str}`, neither of which
have a rigidly optional field unless they were to be annotated.
Prior to this commit we would loosen the rigidity restriction upon
specialization of a generalized type at a use site. However, what we
really want to do is apply the loosening during calculation of
generalization. The reason is that otherwise, we must make types that
would be ground (like `{x ? Str} -> {}`) generalized just for the sake
of the optional field annotation. But since the rigidity constraint is
irrelevant after an annotated body has been checked, we can loosen the
rigidity restriction then, which conveniently happens to coincide with
the generalization calculation.
Closes #3955
2022-09-06 17:44:04 -05:00
Folkert de Vries
3dbf6cc99b
Merge pull request #3859 from roc-lang/dependabot/cargo/insta-1.19.0
...
Bump insta from 1.18.2 to 1.19.0
2022-08-30 12:14:24 +02:00
Ayaz Hafiz
d016d5eeb9
Refine message
2022-08-23 10:39:51 -05:00
Ayaz Hafiz
92ce0c0662
Fix opaque typo
2022-08-23 10:39:51 -05:00
Ayaz Hafiz
cfc46c05ae
Turn on reporting test that works now
2022-08-23 10:39:51 -05:00
Ayaz Hafiz
e77e53f37b
Enable optional record field underivable error
2022-08-23 10:39:51 -05:00
Ayaz Hafiz
55fe1df995
Add more context to derivability errors when they happen
2022-08-23 10:39:50 -05:00
Ayaz Hafiz
d2b9cc056f
Record with optionally-typed fields cannot be derived for decoding
2022-08-23 10:38:30 -05:00
Ayaz Hafiz
958f64c8fc
Turn on reporting test for underivable record
2022-08-23 10:38:02 -05:00
Ayaz Hafiz
4ba132f7d0
Make sure inferring decode into nested function type is an error
2022-08-22 17:06:22 -05:00
dependabot[bot]
0f31f0f07a
Bump insta from 1.18.2 to 1.19.0
...
Bumps [insta](https://github.com/mitsuhiko/insta ) from 1.18.2 to 1.19.0.
- [Release notes](https://github.com/mitsuhiko/insta/releases )
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md )
- [Commits](https://github.com/mitsuhiko/insta/compare/1.18.2...1.19.0 )
---
updated-dependencies:
- dependency-name: insta
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-08-22 05:22:53 +00:00
Ayaz Hafiz
b30c90b500
Don't suggest removing variable when it's bound in a branch pattern
...
Instead, suggest prefixing it with an underscore, or replacing with an
underscore.
Closes #3820
2022-08-19 22:21:44 -05:00
dependabot[bot]
4c6ad52c47
Bump indoc from 1.0.6 to 1.0.7
...
Bumps [indoc](https://github.com/dtolnay/indoc ) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/dtolnay/indoc/releases )
- [Commits](https://github.com/dtolnay/indoc/compare/1.0.6...1.0.7 )
---
updated-dependencies:
- dependency-name: indoc
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-08-15 13:18:18 +00:00
dependabot[bot]
7ab742dd1a
Bump insta from 1.15.0 to 1.18.2
...
Bumps [insta](https://github.com/mitsuhiko/insta ) from 1.15.0 to 1.18.2.
- [Release notes](https://github.com/mitsuhiko/insta/releases )
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md )
- [Commits](https://github.com/mitsuhiko/insta/compare/1.15.0...1.18.2 )
---
updated-dependencies:
- dependency-name: insta
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-08-13 16:49:28 +00:00
Richard Feldman
97e2900bf5
s/rtfeldman/roc-lang/g in links to GitHub repos
2022-08-12 15:24:09 -04:00
Folkert de Vries
0798f787c5
Merge pull request #3736 from rtfeldman/i3687
...
Creation of a record whose type has an optional value is an error
2022-08-11 15:51:41 +02:00
Folkert
5b10ebeeb7
Merge remote-tracking branch 'origin/trunk' into i2453
2022-08-11 10:44:26 +02:00
Folkert de Vries
ae0e90c8f3
Merge pull request #3738 from rtfeldman/i3444
...
Layout generation for recursive lambda sets
2022-08-11 10:22:07 +02:00
Ayaz Hafiz
6dc16521d3
Add illegal case of conditionally creating optional field
...
Closes #3687
2022-08-10 20:24:20 -07:00
Ayaz Hafiz
0bfbeed843
Use Str instead of U64
2022-08-10 20:24:20 -07:00
Ayaz Hafiz
8ccbceaa48
Update reporting tests
2022-08-10 20:24:20 -07:00
Ayaz Hafiz
af19df1a0a
Include optional/required mismatch for rigid optionals
2022-08-10 20:24:19 -07:00
Ayaz Hafiz
81bb889e93
Add RigidOptional record field variant
2022-08-10 20:24:18 -07:00
Ayaz Hafiz
fdb79da5a8
Report anonymous functions as "this function" rather than symbol name
...
Closes #2453
Thanks for the assist @chris-packett
2022-08-10 15:26:52 -07:00
Ayaz Hafiz
5ebb85481c
Update reporting tests
2022-08-09 17:23:27 -07:00
Ayaz Hafiz
d22bd274fd
Check for infinite types of introduced variables before bodies
2022-08-09 14:09:51 -07:00
Ayaz Hafiz
d2015d51f2
Print all argument in tags when their argument lengths mismatch
...
Closes #3553
2022-08-09 12:46:53 -07:00
Ayaz Hafiz
8c87ae50c9
Wrap applied types in parens as appropriate
2022-08-09 12:31:01 -07:00
Ayaz Hafiz
3db07a5697
Reproduce #3553
2022-08-09 12:22:31 -07:00
Richard Feldman
26ee1a01bc
Merge pull request #3691 from rtfeldman/cargo_verson_change
...
changed Cargo versions from 0.1.0 to 0.0.1
2022-08-05 09:13:04 -04:00
Richard Feldman
e685eba42b
fix tests
2022-08-03 19:50:17 -04:00
Anton-4
6a15a7b41b
changed Cargo versions from 0.1.0 to 0.0.1
2022-08-03 11:41:19 +02:00
Ayaz Hafiz
5d1198ae1f
Add more underivable decoding tests
2022-08-02 14:31:17 -05:00
Ayaz Hafiz
36969f0720
Print all derivable abilities
2022-08-02 14:31:17 -05:00
Ayaz Hafiz
4bbc6b74fc
Add derivability obligation checking for Decode
2022-08-02 14:31:16 -05:00
Ayaz
fa14146054
Merge pull request #3531 from rtfeldman/decode
...
Very basic Decode.roc in the standard library
2022-08-02 14:26:28 -05:00
Folkert de Vries
86a1a0f401
Merge pull request #3643 from rtfeldman/disjoint-able-variable-specialization
...
Disjoint able variable specialization algorithm
2022-08-02 20:31:47 +02:00
Ayaz Hafiz
e2f1417224
Update reporting test
2022-08-01 11:40:16 -05:00
Ayaz Hafiz
b87f09115c
Report opaques as opaques, not aliases
...
Closes #3313
Closes #3654
2022-08-01 08:02:56 -05:00
Ayaz Hafiz
2aa69cb3f1
Update test
2022-07-31 19:43:18 -05:00
Ayaz Hafiz
985c43b15b
Don't panic when weird things get into a record
...
Closes #3648
2022-07-31 19:43:18 -05:00
Ayaz Hafiz
4657a957f7
When storing variables, merge them directly with the target rather than unifying
...
When we unify two variables that end up merged, the rank of the
resulting content is the lower of the two variables being merged. But
during storage, we really do mean, take the target descriptor of the
type we're merging against, and don't try to lower to a
possibly-generalized rank! This fixes a couple bugs I didn't even
realize were present!
2022-07-29 14:53:14 -04:00
Ayaz Hafiz
0989b2cb82
Move solve problems to their own crate
2022-07-28 08:57:32 -04:00
Folkert de Vries
01eb161ffe
Merge pull request #3637 from rtfeldman/can-abilities4
...
Syntactic abilities: Part 4 - simplify obligation solving procedure
2022-07-28 11:32:11 +02:00
Folkert de Vries
21fe0ca559
Merge pull request #3639 from rtfeldman/expect-lists
...
Tests for expect output
2022-07-28 08:53:58 +02:00
Richard Feldman
c2865e39ff
Fix stack overflow in reporting
2022-07-27 15:22:36 -04:00
Folkert
e19b272a9e
test expect reporting
2022-07-27 13:51:12 +02:00
Richard Feldman
fa5bd442f8
Merge pull request #3635 from rtfeldman/joshuawarner32/multiline
...
Strip indents and the first/last newline from multiline strings
2022-07-26 22:09:58 -04:00
Ayaz Hafiz
bb14b649a2
Don't re-report obligations that we know were seen elsewhere
2022-07-26 20:46:35 -04:00
Ayaz Hafiz
6b9c1cb690
Check whether opaque implements ability using store
2022-07-26 20:46:35 -04:00
Ayaz Hafiz
8659ddc684
Remove dominated derive errors
2022-07-26 20:46:35 -04:00
Ayaz Hafiz
3703940da9
Report specializations that target the unexpected type
2022-07-26 20:46:34 -04:00
Ayaz Hafiz
b0102a8ae7
Add test for when ability specialization is unused
2022-07-26 20:46:33 -04:00
Folkert
1017bbc5ec
use std::io::Write for making expect messages
2022-07-26 20:12:09 +02:00
Folkert
7014fbb5ec
move expect panic formatting to reporting crate
2022-07-26 18:33:43 +02:00
Ayaz
6b6f240acb
Merge pull request #3589 from rtfeldman/can-abilities3
...
Canonicalize syntactic abilities: Part 3 - solving
2022-07-25 21:48:14 -05:00
Joshua Warner
a579edc6f0
Fix error reporting location for unterminated strings and add test for insufficiently indented multiline strings
2022-07-25 19:07:58 -07:00
Folkert
da4c4c5628
move expect formatting into reporting
2022-07-25 23:49:17 +02:00
Richard Feldman
11ba64c249
Merge pull request #3608 from rtfeldman/more-list-builtins
...
More `List` builtins
2022-07-25 15:23:45 -04:00
Folkert de Vries
d212dffa1a
Merge pull request #3616 from rtfeldman/i3614
...
Compile branches in the presence of degenerate patterns
2022-07-25 19:45:36 +02:00
Folkert
ed71ab3c8f
update reporting test with new suggestion
2022-07-25 19:15:39 +02:00
Richard Feldman
d94f1caa01
Improve a type mismatch message
2022-07-25 19:15:33 +02:00
Ayaz Hafiz
10db3f8574
Detect ability specializations that overload different opaque types
2022-07-25 11:35:20 -04:00
Ayaz Hafiz
51bce825fb
Properly record all erroring ability implementations
2022-07-25 11:30:03 -04:00
Ayaz Hafiz
6035e45f25
Store derivable ability members statically
2022-07-25 09:09:00 -04:00
Richard Feldman
d2dd4f3e0b
Update reporting snapshot
2022-07-24 19:16:48 -04:00
Richard Feldman
d4f192ffd6
Change "an when
" to "a when
" in error message
2022-07-24 19:15:51 -04:00
Ayaz Hafiz
cb42d9b076
Remove subsumed test
2022-07-24 16:11:05 -04:00
Ayaz Hafiz
e15278024a
Add no-introduced-variables test for toplevel defs
2022-07-24 16:11:05 -04:00
Ayaz Hafiz
0de32ac5a9
Warn on definitions that introduce no new variables
2022-07-24 16:11:04 -04:00
Ayaz Hafiz
beccc92c87
Support underscores in assignment patterns
2022-07-24 16:11:03 -04:00
Ayaz Hafiz
569e90d682
Fix test change due to underscore parsing in patterns
2022-07-24 16:10:36 -04:00
Ayaz Hafiz
639fcb076b
Add test for using only underscore as identifier name
2022-07-24 16:10:35 -04:00
Ayaz Hafiz
59ab1da83f
Compile branches in the presence of degenerate patterns
...
Closes #3614
2022-07-22 18:16:02 -04:00
Ayaz Hafiz
1d4e6acd41
Add test for when catchall branches are on different branches
2022-07-22 12:57:27 -04:00
Ayaz Hafiz
13b0ce7ca0
Make sure to apply "is-open" constraints at the very end of pattern constraining
...
Closes #3298
2022-07-22 12:57:27 -04:00
Richard Feldman
b7d78d9237
Merge pull request #3598 from rtfeldman/i3558
...
Compile variables bound in multiple patterns of a branch, and detect unbound patterns
2022-07-21 16:45:52 -04:00
Ayaz Hafiz
78dc82867a
Report errors for identifiers not bound in all patterns of a branch
2022-07-21 12:15:05 -04:00
Richard Feldman
a0237d6aa3
Revise unexpected pattern report
2022-07-20 10:49:06 -04:00
Richard Feldman
55b86f3fe2
Update a test to use new wording
2022-07-20 10:49:06 -04:00
Richard Feldman
6aaa940ddf
Update reporting tests and snapshots
2022-07-20 10:49:06 -04:00
Richard Feldman
024b0c85f8
Report 'a fraction' instead of 'a frac'
2022-07-20 10:49:05 -04:00
Richard Feldman
e389b23e4b
Update wording on arg mismatch
2022-07-20 10:49:05 -04:00
Ayaz Hafiz
7586a8a083
Check complete ability implementations during canonicalization
2022-07-19 14:30:20 -04:00
Ayaz Hafiz
37ab06b0a3
Reject implementations that don't point to abilities
2022-07-19 14:30:19 -04:00
Ayaz Hafiz
e4af8af1a3
Report duplicate implementations for ability members
2022-07-19 14:30:19 -04:00
Ayaz Hafiz
d2da395619
Syntactic ability links in solve
2022-07-18 18:33:28 -04:00
Ayaz Hafiz
17f53a23a5
Update tests
2022-07-18 17:55:02 -04:00
Ayaz Hafiz
c2154ac311
Support shorthand ability implementation syntax
2022-07-18 17:55:01 -04:00
Ayaz Hafiz
870294b564
Update reporting tests
2022-07-18 17:55:01 -04:00
Ayaz Hafiz
e672ce9ebd
First pass at canonicalizing and reporting syntactic abilities
2022-07-18 17:55:01 -04:00
Richard Feldman
ef1daf0f05
Add failing reporting test for ability_member_not_defined
2022-07-18 17:55:00 -04:00
Folkert
b9ebd4fa27
Merge remote-tracking branch 'origin/trunk' into pretty-expect-output
2022-07-15 09:12:04 +02:00
Folkert de Vries
1b1b63aad0
Merge branch 'trunk' into assoc-list-dict
2022-07-14 16:47:50 +02:00
Ayaz
a9243720da
Merge pull request #3496 from rtfeldman/derive-w-mono
...
Monomorphize and compile derived implementations
2022-07-14 07:45:21 -05:00
Folkert
06938429a1
Merge branch 'assoc-list-dict' into pretty-expect-output
2022-07-14 00:39:01 +02:00
Folkert
5763248b44
Merge remote-tracking branch 'origin/trunk' into assoc-list-dict
2022-07-13 20:44:28 +02:00
Richard Feldman
bf63c45b46
Compute src_dir from original filename
...
This fixed a bug where bindgen was providing cwd() for src_dir,
but actually the src_dir should have been based on the filename.
This prevents that problem from happening in the future!
2022-07-13 12:49:06 -04:00
Folkert
e921fe6515
add code for rendering the result
2022-07-13 14:57:08 +02:00
Ayaz Hafiz
f7dea48418
Update reporting test
2022-07-13 08:47:41 -04:00
Ayaz Hafiz
3708ed7c90
Remove stale test for inferred encodable type variables
2022-07-13 08:47:40 -04:00
Ayaz Hafiz
df9bcb1a0c
Use Derived_synth for synthesizing implementations, and Derived_gen for codegen
2022-07-13 08:47:39 -04:00
Ayaz Hafiz
9a01117536
Fix compile errors
2022-07-13 08:47:37 -04:00
Ayaz Hafiz
d8bee6cd18
Perfom derives from global derives module, not just symbol table
2022-07-13 08:47:36 -04:00
Folkert
cbd6052dbb
fix dict/set not being in scope
2022-07-13 14:04:38 +02:00
Ayaz Hafiz
f1a6ea6a40
Typecheck and compile opaque wrapping functions
...
This enables you to write something like
```
A := U8
List.map [1, 2, 3] @A
```
which will be compiled as if it was `List.map [1, 2, 3] \x -> @A x`.
Closes #3499
2022-07-12 18:38:03 -04:00
Folkert de Vries
f1aae6f480
Merge pull request #3476 from rtfeldman/i3469
...
Remove more builtins code
2022-07-10 23:06:50 +02:00
Ayaz Hafiz
1acc6434ae
Remove add_aliases
2022-07-10 10:46:58 -04:00
Ayaz Hafiz
b04f704b99
Remove constrain_builtin_imports
2022-07-10 10:46:18 -04:00