roc/src/cli
Richard Feldman 79a08d5d0f
Fix List.get with method syntax causing cycle in layout computation
When calling List.get with method syntax (my_list.get(0)), the
interpreter was causing a cycle in layout computation because rigid
type variables weren't being properly resolved.

The fix unifies the method's first parameter type with a copy of the
receiver type before instantiation. This properly resolves rigid type
variables (like `item` in List.get) to concrete types. A copy of the
receiver type is created before unification to avoid corrupting the
original type, since unification modifies both sides.

This is the same approach used for no-args method dispatch (like
List.first), but with the additional copy step needed because the
multi-args path may reuse types across multiple method invocations.

Fixes #8662

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 15:43:09 -05:00
..
test Fix List.get with method syntax causing cycle in layout computation 2025-12-13 15:43:09 -05:00
bench.zig Fix some more violations 2025-12-04 02:02:38 -05:00
builder.zig convert more user facing errors to use reporting system, remove dead 2025-12-10 08:50:55 +11:00
cli_args.zig big cleanup 2025-12-11 11:20:08 +11:00
cross_compilation.zig Cleanup target handling and deuplication 2025-12-09 13:30:36 +11:00
libc_finder.zig skip test using uname on windows 2025-11-25 08:44:10 +11:00
linker.zig ensures all symbols from the static library are included 2025-12-11 17:24:40 +11:00
main.zig make bundle more lenient, and improve errors 2025-12-11 17:24:41 +11:00
platform_host_shim.zig initial implementation 2025-12-10 15:37:13 +11:00
platform_validation.zig make bundle more lenient, and improve errors 2025-12-11 17:24:41 +11:00
README.md Update README's 2025-08-12 18:26:26 +10:00
target.zig always use portable serialization when embedding modules 2025-12-11 09:01:53 +11:00
targets_validator.zig WIP - adding more reporting, restore glibc support 2025-12-09 09:51:47 +11:00
test_docs.zig Delete a ton of unused arguments 2025-12-04 01:45:48 -05:00
test_shared_memory_system.zig check for parse/token errors and print them on run (#8586) 2025-12-08 21:10:16 +01:00

CLI

This directory contains the source code for the roc command-line interface (CLI) tool.

The CLI is the main entry point for developers using Roc. Its responsibilities include:

  • Command Parsing: Parsing commands (e.g., build, run, fmt, test) and their options through cli_args.zig
  • Compilation Orchestration: Managing the compilation pipeline and integrating with the Roc compiler
  • Linker Integration: Using an abstraction for the LLD linker as a library through linker.zig for code generation
  • Performance Profiling: Integration with Tracy profiler for performance analysis
  • Testing & Benchmarking: Built-in testing and benchmarking capabilities through bench.zig
  • Shared Memory Management: Testing utilities for the shared memory system used in IPC

The CLI coordinates between the compiler frontend (parsing, type checking) and backend (code generation, linking) to provide a seamless development experience.