Commit graph

58 commits

Author SHA1 Message Date
ayazhafiz
cf628ed4ef Fix clippy warning 2022-02-27 12:21:20 -05:00
ayazhafiz
720b7b49d2 Improve error pattern and fix tests 2022-02-27 12:01:12 -05:00
ayazhafiz
34900c1f55 Address @rtfeldman review 2022-02-27 00:11:11 -05:00
ayazhafiz
059c324268 Error reporting for type mismatches involving opaques 2022-02-27 00:10:12 -05:00
ayazhafiz
ccd4963e0f Fix clippy warnings 2022-02-27 00:10:12 -05:00
ayazhafiz
86aa0df661 Add constraint generation for opaque types 2022-02-27 00:10:11 -05:00
Brendan Hansknecht
f7c0e2ef19 Merge remote-tracking branch 'origin/trunk' into single-quote-literal 2022-02-24 10:13:39 -08:00
ayazhafiz
90de82e295 Validation of opaques during canonicalization 2022-02-21 18:25:19 -05:00
ayazhafiz
6104a27b45 Parse opaque references 2022-02-19 21:30:42 -05:00
Folkert
637360fad5
clippy 2022-02-19 16:50:42 +01:00
ayazhafiz
c5d918e68c Include floats in bounds for unspecified numbers 2022-02-06 15:04:12 -05:00
ayazhafiz
5e0d90ac53 First pass 2022-02-06 15:04:12 -05:00
ayazhafiz
097c5afc73 Check lower bounds for numeric literals, and permit 128-bit literals 2022-02-02 23:35:57 -05:00
ayazhafiz
e7dcc2daa5 Move NumWidth to roc_can 2022-02-02 00:23:43 -05:00
ayazhafiz
df8113ce32 Typecheck numeric suffixes in patterns 2022-02-01 23:35:14 -05:00
ayazhafiz
a6f7579c07 Parse and expand numeric bounds in canonicalization pass 2022-02-01 22:50:46 -05:00
ayazhafiz
e03592930f Typecheck numeric literals with suffixes in expressions
Part of #2350
2022-02-01 22:49:50 -05:00
ayazhafiz
320827167f Parse number literal width suffixes
Supports [u,i][8,16,32,64,128] and [nat,dec]

Part of #2350
2022-02-01 22:48:48 -05:00
ayazhafiz
0eede1cd86 Generate unique symbols for shadowing identifiers
This code has a shadowing error:

```
b = False
f = \b -> b
f b
```

but prior to this commit, the compiler would hit an internal error
during monomorphization and not even get to report the error. The reason
was that when we entered the closure `\b -> b`, we would try to
introduce the identifier `b` to the scope, see that it shadows an
existing identifier, and not insert the identifier. But this meant that
when checking the body of `\b -> b`, we would think that we captured the
value `b` in the outer scope, but that's incorrect!

The present patch fixes the issue by generating new symbols for
shadowing identifiers, so deeper scopes pick up the correct reference.
This also means in the future we may be able to compile and execute code
with shadows, even though it will still be an error.

Closes #2343
2022-01-23 12:35:31 -05:00
Joshua Warner
f19220473a Rename Located -> Loc 2021-12-22 19:18:22 -08:00
Chelsea Troy
f680ee3c24 Fix a spelling mistake; how was this ever passing? 2021-12-01 18:41:37 -06:00
Chelsea Troy
6cf755ad8d Resolve a bunnnch of merge conflicts 2021-11-29 23:14:29 -06:00
Joshua Warner
a4ca6a31a6 Use Collection in Expr::Record and related places 2021-11-13 07:36:05 -08:00
Eric Correia
8272ea876f Get it all to compile! 2021-10-02 13:48:07 -04:00
Jared Ramirez
d69b9173fc Also store f64 for things like pattern comparisons, etc 2021-08-18 17:18:13 -07:00
Jared Ramirez
adabf70132 [WIP] Update can & pattern to store numbers as validated strs 2021-08-16 16:16:10 -07:00
Folkert
899cbeabd7 fix extra ampersands 2021-07-29 17:32:08 +02:00
Folkert
2bb1f2cca7 improve error reporting for underscore expr 2021-04-12 20:48:58 +02:00
Folkert
2827af7e59 remove Nested from pattern 2021-03-21 21:03:37 +01:00
Folkert
a87dfac7da improved malformed patterns 2021-03-01 16:12:37 +01:00
rvcas
b34436e5cb Merge branch 'trunk' into int_a_float_a 2021-01-04 09:53:45 -05:00
Folkert
754521c4c3 all the clippy fixes 2021-01-01 00:40:41 +01:00
rvcas
127c4e1bcc feat: add inner var to IntLiteral and FloatLiteral 2020-12-29 20:52:54 -05:00
Folkert
7bedc3ff6e ident and tags 2020-12-18 00:53:31 +01:00
Folkert
4db48d9f13 more clippy things 2020-11-19 22:20:00 +01:00
rvcas
8df5d5c13c feat(parse): support capturing a str in Pattern::Underscore 2020-11-17 21:53:49 -05:00
Folkert
9b83c3ad58 optional record fields in patterns are bound 2020-10-16 15:29:21 +02:00
Folkert
e656363cc0 restrain the set of captured variables further 2020-10-16 01:42:06 +02:00
Folkert
40ffca2b7b IT WORKS 2020-10-16 00:18:40 +02:00
Richard Feldman
7682e09b0a Fix some fmt stuff 2020-08-31 23:13:50 -04:00
Richard Feldman
274e7e786d Constrain string interpolation 2020-08-31 23:13:50 -04:00
Richard Feldman
f35e43768a Get things compiling 2020-08-31 23:13:50 -04:00
Folkert
f48a661b3d fixing tests 2020-07-31 00:49:16 +02:00
Richard Feldman
71f929aba2 Count default exprs as having used things 2020-07-20 21:58:05 -04:00
Folkert
29c3eebace parse default optional expressions in pattern matches 2020-07-20 00:52:16 +02:00
Richard Feldman
7330e82f75 Constrain optional fields 2020-07-18 14:51:18 -04:00
Richard Feldman
8b53ec15fe Change guard to DestructType 2020-07-18 12:42:04 -04:00
Folkert
9d67b11c0d pretty error messages for integers 2020-07-07 22:10:23 +02:00
Folkert
e595c14fae wip 2020-07-06 20:38:10 +02:00
Folkert
b7d689226c cover all parsed patterns with an error message
but, some invalid patterns are not parsed as expected. See https://github.com/rtfeldman/roc/issues/399
2020-07-04 20:39:49 +02:00