Commit graph

436 commits

Author SHA1 Message Date
Ayaz Hafiz
2961d1a8be
Remove redundant reference 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
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
6149c289fc
Update Eq symbols 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
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
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
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
92aa0912ea
Report unused imports in modules 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
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
0f0e414272
Improve error message for uninhabited patterns 2022-09-19 10:55:02 -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
Jan Van Bruggen
431455dd1b
Rephrase web/terminal-related "platform" to "environment" 2022-09-11 10:25:02 -06: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
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
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
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
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
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
36969f0720
Print all derivable abilities 2022-08-02 14:31:17 -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
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