Closed
Labels
error-messagesProblems with compiler diagnostics and UX
Description
Current behavior
use crux.view
error: expected identifier
--> test/smoke.w:2:4
2 | use crux.view
| ^
The caret points at crux, not view. There is zero indication that view is a reserved keyword causing the failure. An agent will try renaming crux, restructuring the path, changing the import style — everything except renaming the module.
Expected behavior
error: 'view' is a reserved keyword and cannot be used as a module name
--> test/smoke.w:2:10
2 | use crux.view
| ^^^^
= help: rename the module to avoid the keyword, e.g. 'views'
Broader issue
There should be a way to discover which words are reserved. Either:
with help keywordslists all reserved words- The error message names the specific keyword that collided
Without this, users have to discover reserved words by trial and error.
Repro
mkdir -p /tmp/wbug/lib/crux
echo "pub fn make_view -> i32: 42" > /tmp/wbug/lib/crux/view.w
printf "use crux.view\nfn main: let x = make_view()\n" > /tmp/wbug/main.w
cd /tmp/wbug && with check main.wMetadata
Metadata
Assignees
Labels
error-messagesProblems with compiler diagnostics and UX
Activity
ehartford commentedon Mar 20, 2026
Verified on current
main: the originaluse crux.viewrepro no longer errors. A temporary module atlib/crux/view.wimports and checks cleanly now, so this issue no longer reflects current behavior.sema: record bitnot result type (sidecar gap withlang-dev#6); literal…
Revert "sema: record bitnot result type (sidecar gap withlang-dev#6);…
MirLower: a call through a let-alias of a non-Copy fn field calls the…
MirLower: a call through a let-alias of a non-Copy fn field calls the…