Commit graph

921 commits

Author SHA1 Message Date
Anton-4
3db296648f
fix undefined behavior warning (#7835)
Fixed a warning that shows when using rust 1.87
2025-06-17 15:37:59 +02:00
Lars Frogner
560171c238
Add Num.[f32,f64,dec]_[to,from]_bits builtins and deprecate Num.[f32,f64]_[to,from]_parts (#7741)
* Add `Num.[f32,f64,dec]_[to,from]_bits` builtins

* Update mono tests

* Deprecate `Num.[f32,f64]_[to,from]_parts`
2025-04-18 10:10:45 +02:00
Anton-4
e9690c9bce
Lowercased some files (#7713) 2025-03-24 16:43:18 +01:00
snobee
4f7729c044
Merge remote-tracking branch 'upstream' into annotate-type-signatures 2025-01-27 14:21:24 -08:00
Sam Mohr
c7da4f714e
Merge branch 'main' into fix-pnc-try 2025-01-25 05:46:29 -08:00
Sam Mohr
1aff18d47c
Fix PNC + ? suffix interaction 2025-01-25 05:41:59 -08:00
Norbert Hajagos
fc0a9ec4cf
add with_ascii_uppercased and caseless_ascii_equals to Str 2025-01-23 15:21:11 +01:00
shua
6c29d7aa1f
Merge branch 'main' into fromutf-roc 2025-01-20 19:16:38 +01:00
Norbert Hajagos
8403f1ea19
with_ascii_lowercased zig builtin 2025-01-20 10:58:41 +01:00
Sam Mohr
809fe23afd
Merge pull request #7533 from smores56/simple-can-solo
Move desugaring to new `roc_can_solo` crate
2025-01-19 19:06:10 -08:00
Luke Boswell
c8467b1fe0
Merge pull request #7454 from roc-lang/ayaz/error-on-invalid-generalized-types
Restrict usages of type variables in non-generalized contexts
2025-01-20 11:30:52 +11:00
Sam Mohr
fce14d31b0
Move desugaring to new roc_can_solo crate 2025-01-19 07:16:43 -08:00
Sam Mohr
7914f0c7d8
Fix clippy issue 2025-01-17 20:01:54 -08:00
Sam Mohr
1a9668e83a
Add tests for desugaring and formatting 2025-01-17 18:55:58 -08:00
shua
17624a9d2c
Merge branch 'main' into fromutf-roc 2025-01-18 01:58:14 +01:00
Sam Mohr
a292e070d4
Prefer and and or for boolean operators 2025-01-17 16:15:31 -08:00
Sam Mohr
5859415e73
Prefix hidden vars with # 2025-01-16 10:49:51 -08:00
Sam Mohr
474fd15dd4
Fix formatting 2025-01-16 03:21:34 -08:00
Sam Mohr
b73e4387ae
Implement ? binop operator 2025-01-16 02:44:32 -08:00
snobee
406cc6c5e9
Merge remote-tracking branch 'upstream' into annotate-type-signatures 2025-01-15 21:15:32 -08:00
Anthony Bullard
8e1e1520e3
New Lambda Syntax with |...|
This adds parser support for the new lambda syntax.  It does not remove
the existing syntax, nor will the new syntax be retained in formatting.
That will be done in a separate PR to keep the two respective PRs
relatively small and easy to review.
2025-01-15 05:58:16 -06:00
Joshua Warner
d43ad92789
Introduce proper type for TypeVar's, mark anything not a lowercase ident as malformed 2025-01-14 19:30:33 -08:00
shua
414fecd14d
add fromUtf16 and 32, as well as lossy variants 2025-01-15 00:17:09 +01:00
Joshua Warner
853dd5725b
Also handle large tuple indices in a.123 form 2025-01-11 20:24:35 -08:00
Joshua Warner
61bc0b3464
Resolve TODO around handling non-plain strings 2025-01-11 20:24:34 -08:00
Joshua Warner
e0ef01fa82
Fix two canonicalization crashes: try() and overflowed tuple indexes 2025-01-11 20:24:34 -08:00
Joshua Warner
7d464a2989
add failing test for ignored fields canonicalization 2025-01-11 20:24:33 -08:00
Joshua Warner
408379f8d3
Canonicalize the pattern in annotations 2025-01-11 20:24:30 -08:00
Joshua Warner
13a70c060d
Preserve info about whether a given dbg stmt was pnc or not, at least for now 2025-01-10 21:10:55 -08:00
Ayaz
ee3c71dfe6
Merge branch 'main' into ayaz/error-on-invalid-generalized-types
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
2025-01-10 14:36:48 -05:00
Sam Mohr
eb1b5ffa26
Move to new interpolation syntax 2025-01-10 10:29:20 -08:00
Sam Mohr
279301faa3
Remove unused insta dependency from can 2025-01-08 18:02:44 -08:00
Sam Mohr
82b7279485
Fix formatting 2025-01-08 17:04:28 -08:00
Sam Mohr
2150ee2219
Remove Task from Roc 2025-01-08 17:00:40 -08:00
Anthony Bullard
9b9b6d39f3
Fix clippy 2025-01-08 15:37:03 -06:00
Anthony Bullard
739dda6f5e
Cover hidden pattern match cases for Pizza 2025-01-08 15:05:55 -06:00
Anthony Bullard
898b3f55e5
Move PNC apply to separate Expr/Pattern variant 2025-01-08 14:47:49 -06:00
Sam Mohr
8e5d875604
Merge branch 'main' into auto-snake-case 2025-01-08 01:51:12 -08:00
Luke Boswell
99dfc5529d
Merge pull request #7450 from roc-lang/ayaz/bugfix-ts
Minor simplifications to typechecker
2025-01-08 16:28:25 +11:00
Sam Mohr
7a2f8bfa71
Merge branch 'main' into auto-snake-case 2025-01-07 13:18:41 -08:00
Ayaz Hafiz
54cc5e4c29
Unify let-introduction in a single path
Remove branches on determining how let-bindings are introduced to the
scope. This is maybe a little more inefficient, but I think it is a huge
simplification.

One additional change this required was changing how fx suffixes are
checked. The current implementation would add additional constraints for
patterns in let bindings conditionally. However, this is unnecessary. I
believe it is sufficient to check the fx suffix by running the checks on
all introduced symbols after the type is well known (i.e. the body is
checked).
2025-01-05 23:54:37 -05:00
Ayaz Hafiz
bd2dd66c96
Store rigid vars with location during constraining 2025-01-05 23:54:36 -05:00
Joshua Warner
6edfc0aa90
Fix double-wrapping of spaces before implements opaque keyword by making them distinct 2025-01-05 15:10:13 -08:00
Sam Mohr
b56fbd38e1
Progress on updating entire compiler for snake_case 2025-01-05 03:48:03 -08:00
Sam Mohr
db1e0a02b4
Update tests 2025-01-04 05:54:44 -08:00
Sam Mohr
30b8a1407d
Fix broken ability implementation 2025-01-04 05:37:17 -08:00
Anthony Bullard
210695ec29
Update can tests with PatternApplyStyle after rebase 2025-01-02 18:11:15 -06:00
Anthony Bullard
3b0db07fa1
PNC for Patterns, stabilize formatting 2025-01-02 17:57:15 -06:00
Ayaz Hafiz
a0461679dd Restrict usages of type variables in non-generalized contexts
Type variables can only be used on functions (and in number literals as
a carve-out for now). In all other cases, a type variable takes on a
single, concrete type based on later usages. This check emits errors
when this is violated.

The implementation is to check the rank of a variable after it could be
generalized. If the variable is not generalized but annotated as a type
variable, emit an error.
2025-01-02 14:26:37 -06:00
Ayaz Hafiz
c3d77b8841 Unify let-introduction in a single path
Remove branches on determining how let-bindings are introduced to the
scope. This is maybe a little more inefficient, but I think it is a huge
simplification.

One additional change this required was changing how fx suffixes are
checked. The current implementation would add additional constraints for
patterns in let bindings conditionally. However, this is unnecessary. I
believe it is sufficient to check the fx suffix by running the checks on
all introduced symbols after the type is well known (i.e. the body is
checked).
2025-01-01 23:39:37 -06:00