mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-23 08:48:03 +00:00
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> |
||
|---|---|---|
| .. | ||
| test | ||
| bench.zig | ||
| builder.zig | ||
| cli_args.zig | ||
| cross_compilation.zig | ||
| libc_finder.zig | ||
| linker.zig | ||
| main.zig | ||
| platform_host_shim.zig | ||
| platform_validation.zig | ||
| README.md | ||
| target.zig | ||
| targets_validator.zig | ||
| test_docs.zig | ||
| test_shared_memory_system.zig | ||
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 throughcli_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.zigfor 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.