Skip to content

Conversation

@lukewilliamboswell
Copy link
Collaborator

@lukewilliamboswell lukewilliamboswell commented Jan 7, 2026

Summary

Fixes #8947 by adding for-clause type alias mappings to the platform-to-app ident translation map.

For-clause type aliases (e.g., [Model : model] for main) weren't being added to the translation map, causing false "MISSING PLATFORM REQUIRED TYPE" errors during roc check.

Note: The original issue also had a rank mismatch panic ("trying unifyWith unexpected ranks 1 & 0"), but that was fixed separately by #8945. This PR now only contains the type alias lookup fix.

Changes

Fixed type alias lookup in src/compile/compile_build.zig and src/cli/main.zig

Added for-clause type alias mappings to the platform-to-app ident translation map. This ensures both the alias name (e.g., "Model") and rigid name (e.g., "model") are properly mapped when checking platform requirements.

Added regression test in src/cli/test/roc_subcommands.zig

Test verifies that roc check test/int/app.roc does not panic.

Test Plan

  • roc check test/int/app.roc - Reports "No errors found" (previously showed false errors)
  • roc test/int/app.roc - Works correctly, reports "ALL TESTS PASSED"

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 [email protected]

@lukewilliamboswell lukewilliamboswell marked this pull request as ready for review January 7, 2026 06:48
@jaredramirez
Copy link
Collaborator

At least the rank part of this should also be fixed by #8945

For-clause type aliases (e.g., `[Model : model] for main`) weren't being
added to the platform-to-app ident translation map, causing false
"MISSING PLATFORM REQUIRED TYPE" errors during `roc check`.

This change adds the alias name (e.g., "Model") and rigid name (e.g., "model")
mappings in both compile_build.zig and main.zig, ensuring the type checker
can properly resolve platform requirement types.

Note: The original issue #8947 also had a rank mismatch panic, but that
was fixed separately by #8945. This PR now only contains the type alias
lookup fix.

Fixes #8947

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@lukewilliamboswell lukewilliamboswell changed the title Fix #8947: Rank mismatch panic in checkPlatformRequirements Fix type alias lookup for platform requirements Jan 9, 2026
@jaredramirez jaredramirez merged commit a5a7849 into main Jan 10, 2026
35 checks passed
@jaredramirez jaredramirez deleted the fix-issue-8947 branch January 10, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

roc check crashes for Int test app "trying unifyWith unexpected ranks 1 & 0"

3 participants