Commit graph

36576 commits

Author SHA1 Message Date
Anton-4
3df786f86d
fix runtime type propagation 2025-12-22 13:05:15 +01:00
Anton-4
eb6d619988
test + list type improvement 2025-12-19 17:35:00 +01:00
Fabian Schmalzried
21c4cd5dfc
Improve render helper to render lists of tags correctly (#8702)
Improve render helper to render list content correctly
2025-12-19 10:32:33 +01:00
Luke Boswell
576feb3b26
Merge pull request #8629 from roc-lang/implement-box
Implement `Box` builtin
2025-12-19 13:10:16 +11:00
Jared Ramirez
54f0045112
Update snapshots 2025-12-18 12:42:33 -05:00
Jared Ramirez
ee9a76d80c
Add nice error messages 2025-12-18 12:11:03 -05:00
Jared Ramirez
985ce728d5
Revert rank change + required type alias strategy 2025-12-18 11:16:50 -05:00
Anton-4
d4d1c9d0c4
Fix #8699 (#8701) 2025-12-17 19:54:17 +01:00
Matthieu Pizenberg
0392a93d1b
Implement bitwise shifts (#8469)
* Implement bitwise shifts

Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>

* Add low_level_interp shift tests

Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>

* Fix wrong test

Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>

* Use appropriate byte size for shifts

Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>

* Simplify shift left and right interpreter

Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>

* Factorize the num_shift_right_zf_by in interpreter

Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>

* Add edge cases tests for shifts

Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>

* Fix an edge case test

Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>

* Truncate shift left to the correct precision

Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>

* Add shift operators to the borrow switch

Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>

* restore accidental deletions

---------

Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>
Co-authored-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-12-17 19:32:38 +01:00
Anton-4
2c3fb53a57
output msg if roc build succeeds (#8700) 2025-12-17 17:14:23 +01:00
Anton-4
aad17ac6bf
fix if else fmt without {} (#8698) 2025-12-17 16:36:17 +01:00
Luke Boswell
a6601b542c
try fix return pointer alignment mismatch 2025-12-17 22:41:23 +11:00
Anton-4
49a7f53600
more windows unicode fixes (#8697) 2025-12-17 12:35:22 +01:00
Luke Boswell
58ecb6952f
use e_crash for hosted functions 2025-12-17 21:35:42 +11:00
Luke Boswell
8c75408a0d
Merge pull request #8695 from roc-lang/cli-err-reporting
Refactor cli
2025-12-17 21:21:44 +11:00
Luke Boswell
f6430cb5c6
Merge remote-tracking branch 'remote/cli-err-reporting' into implement-box-with-cli-err-reporting 2025-12-17 15:28:54 +11:00
Luke Boswell
08e798f080 fix handles the InvalidUtf8 error from utf8ToUtf16LeAllocZ calls in the Windows handle inheritance 2025-12-17 14:44:25 +11:00
Luke Boswell
6f7a294150
fix test lint for Windows 2025-12-17 14:35:34 +11:00
Luke Boswell
42937e1728
fix windows targets for test platforms 2025-12-17 14:35:16 +11:00
Luke Boswell
d0b451fb78
start re-organizing, leave a plan for future PR's 2025-12-17 14:33:52 +11:00
Luke Boswell
6a1086e0a9
migrate IO to ctx, add new violation check 2025-12-17 14:03:22 +11:00
Richard Feldman
12dac2cec7
Merge pull request #8669 from roc-lang/fix-issue-8666
Fix panic when using polymorphic numeric as list index
2025-12-16 21:24:55 -05:00
Luke Boswell
0cfbf2a6c4
WIP - ctx migration 2025-12-17 13:09:31 +11:00
Luke Boswell
c64502f88d
WIP migrate ctx 2025-12-17 12:23:48 +11:00
Luke Boswell
a54ed1cf15
WIP - migrate ctx 2025-12-17 11:56:04 +11:00
Luke Boswell
b411657a07
WIP - more ctx migrations 2025-12-17 11:42:34 +11:00
Luke Boswell
aad6395974
WIP - migrate to cli ctx 2025-12-17 11:08:22 +11:00
Luke Boswell
e0360be969
Merge pull request #8694 from roc-lang/fix-8693
Use `exports` (not `all_defs`) to only include exported platform definitions as entrypoints
2025-12-17 09:40:35 +11:00
Luke Boswell
a0a5c7483a
Update main.zig 2025-12-17 09:40:15 +11:00
Luke Boswell
654fbed061
fix str platform imports 2025-12-17 09:08:56 +11:00
Luke Boswell
3a333c2187
exports (not all_defs) to only include exported definitions as entry
points
2025-12-17 09:05:03 +11:00
Luke Boswell
f135228291
exports (not all_defs) to only include exported definitions as entry
points
2025-12-17 09:03:33 +11:00
Luke Boswell
7379f5d18a
print compilation errors for roc build too 2025-12-17 08:26:11 +11:00
Richard Feldman
82673a0f76
Merge pull request #8690 from roc-lang/fix-issue-8689
Fix field access on record payload in tag union wrapped by opaque type
2025-12-16 13:35:32 -05:00
Hubert Małkowski
2937d64456
Show test summary without --verbose flag (#8554) (#8691)
* show test summary without --verbose flag (#8554)

* remove outdated comments

* shorten passed msg

---------

Co-authored-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-12-16 19:10:48 +01:00
Anton-4
7758b8d686
retry on timeout
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-12-16 18:28:44 +01:00
Anton-4
4708a1f52f
retry on gateway timeout
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-12-16 18:26:27 +01:00
Anton-4
8cbd6034ec
fix non-printable unicode carriage return windows (#8692) 2025-12-16 18:18:55 +01:00
Anton-4
f3f80d2a2c
retry on downloadToFile error
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-12-16 18:18:18 +01:00
Richard Feldman
03535a5786
Convert fx test to eval snapshot test for issue #8689
The eval snapshot test is faster and more appropriate since the bug
is in the canonicalization phase. The test verifies both that the
code canonicalizes correctly (no incorrect captures) and that it
evaluates correctly at runtime.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 12:14:25 -05:00
Fabian Schmalzried
22159f2c5c
Add List.repeat builtin (#8688)
* Add List.repeat builtin

* format Builtin.roc
2025-12-16 14:27:51 +01:00
Richard Feldman
641f4db0b0
Update snapshots for nominal pattern bound variable fix
The fix correctly identifies that variables bound inside nominal
patterns (like `s` in `Container.Box(s)`) are bound in the pattern
scope and don't need to be captured. This results in cleaner
canonical IR where functions that use nominal pattern matching
are now represented as pure lambdas instead of closures with
unnecessary captures.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 07:55:22 -05:00
Richard Feldman
9f143f79ec
Fix nominal pattern bound variable collection (issue #8689)
collectBoundVarsToScratch was not recursing into the backing pattern
for nominal and nominal_external patterns. This caused variables
bound in nominal patterns (e.g., Wrapper.Simple(s)) to not be tracked
as bound variables, leading to them incorrectly being included in the
free variables of match expression bodies.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 07:53:38 -05:00
Fabian Schmalzried
bb52264221
Grow arrays exponentially (#8682)
* Grow arrays exponentially

This leads to a speedup for AoC code from ~19s to ~300ms

* Grow ArrayListMap the same was as std.ArrayList

* Let ArrayList do the growing for var_to_layout_slot

---------

Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
Co-authored-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-12-16 13:38:20 +01:00
Luke Boswell
2edc1f4c86 fix windows targets for test platforms 2025-12-16 23:12:39 +11:00
Luke Boswell
9e79f3f924 fix test lint for Windows 2025-12-16 22:59:52 +11:00
Luke Boswell (Linux-Desktop)
83266eb7b0
merge changes from remote/main 2025-12-17 06:57:47 +11:00
Luke Boswell
7b31e3204c
fix recursive addTypeVar corrupting work stack
The layout computation's addTypeVar function was clearing work fields
(pending_record_fields, pending_tuple_fields, pending_tags, etc.) at
the start of every call via clearRetainingCapacity(). This caused
corruption when processing nested types that trigger recursive calls.

Example problem case:
  { tag: Str, attrs: List([StringAttr(Str, Str), BoolAttr(Str, Bool)]) }

When processing this record:
1. Record handling pushes fields to pending_record_fields
2. Processing the List element triggers tag union handling
3. Tag union handling makes recursive addTypeVar calls for variant payloads
4. These recursive calls cleared pending_record_fields
5. When returning to finalize the outer record, pop() found empty stack

The fix removes clearRetainingCapacity entirely. All work fields now
persist across recursive calls and are cleaned up individually:
- pending_containers: pop() when container layout is finalized
- in_progress_vars: swapRemove() when type is cached
- pending_record_fields: pop() when field is resolved
- pending_tags: shrinkRetainingCapacity() via defer

This fixes the unreachable panic in roc-dom when rendering elements
with complex nested types like List([String(Str,Str), Bool(Str,Bool)]).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 22:32:28 +11:00
Anton-4
43dd3d9ed0
Add 'Timeout' for retries
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-12-16 12:23:20 +01:00
Luke Boswell
15966a2525
fix nominal pattern binding in method blocks
Two related issues were preventing methods with nominal patterns like
`|Widget.Content(s)|` from working:

1. In the canonicalizer, `collectBoundVarsToScratch` wasn't recursing
   into `.nominal` and `.nominal_external` patterns, causing variables
   bound inside them (like `s`) to be incorrectly treated as captures
   instead of pattern-bound variables.

2. In the interpreter, no-args method dispatch was directly appending
   bindings without using `patternMatchesBind`, which meant nested
   patterns weren't properly bound. The body's `e_lookup_local` would
   look for a `p-assign` pattern_idx but only find the outer `p-nominal`.

The fix makes both cases properly recurse into nominal patterns to find
and bind all nested pattern variables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 21:00:02 +11:00