Commit Graph

323 Commits

Author SHA1 Message Date
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
Ayaz Hafiz
98287e7670
Remove imported_builtins from load 2022-07-10 10:41:06 -04:00
Richard Feldman
f45e3dbb46
Fix tests 2022-07-08 18:16:08 -04:00
Ayaz Hafiz
e118573896
Add test to check structural recursion vars cannot leak into opaques 2022-07-08 15:31:44 -04:00
ayazhafiz
161d6b45f2
Stray dbg 2022-07-05 22:30:34 -04:00
Ayaz Hafiz
c154a337a9
Get deep range numbers working 2022-07-05 22:16:52 -04:00
Ayaz Hafiz
5a18490050
Support ordering floats in numeric literal bounds 2022-07-05 22:16:51 -04:00
Ayaz Hafiz
1905e1815d
Detect when big number literals cannot fit into the same type 2022-07-05 22:16:49 -04:00
Ayaz Hafiz
fc1617bf17
Phantom types
Closes #3314
2022-07-05 19:07:41 -04:00
ayazhafiz
b490a1fdf8
Replace other test_reporting tests with snapshots 2022-07-03 14:19:57 -04:00
ayazhafiz
375b3e064a
Use insta snapshot tests in reporting tests 2022-07-03 12:58:27 -04:00
Anton-4
b74fc3554b
Merge branch 'trunk' of github.com:rtfeldman/roc into crates-folder 2022-07-02 12:35:19 +02:00
Anton-4
eee85fa45d
moved all crates into seperate folder + related path fixes 2022-07-01 17:37:43 +02:00