Skip to content

error is contextual: it opens a declaration only before a name (§29.11, #3131) - #3279

Merged
ehartford merged 2 commits into
mainfrom
error-contextual
Nov 12, 2026
Merged

ehartford merged 2 commits into
mainfrom
error-contextual

Conversation

@ehartford

@ehartford ehartford commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

error leaves the reserved words: before a name it opens an error declaration (§10.8) or states a contract's error type (§16.2b.4), and elsewhere it is an ordinary identifier, so let error = …, a field and a parameter named error compile. §29.11 words blessed by Eric 2026-11-12.

Closes #3131.

Battery GREEN on the stack top 7c2a202. UAT: 13 scenarios, 12 pass, 1 skip (raylib_spiral_windows, not a darwin scenario).

Eric Hartford added 2 commits November 12, 2026 13:28
The lexer no longer reserves the word. The parser reads `error Name` at a
declaration start and in a facade header from the text, as it reads
`c facade`. A bare variant on a line of its own is indented under its
declaration, so a name at the declaration's indent starts the next item
(the keyword used to end the list by accident).

Test: test/behavior/behav_3131_error_is_contextual.w (failed before: the
field, parameter and binding named `error` were refused).
@ehartford
ehartford added this pull request to stack #3281 November 12, 2026 21:49
@ehartford ehartford changed the title error contextual error is contextual: it opens a declaration only before a name (§29.11, #3131) Nov 12, 2026
@ehartford
ehartford marked this pull request as ready for review November 12, 2026 21:50
@ehartford
ehartford merged commit f00b2c6 into main Nov 12, 2026
@ehartford
ehartford deleted the error-contextual branch November 12, 2026 21:50
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.

error is a reserved word but only ever starts a declaration: make it contextual so error works as a field, binding or parameter name

1 participant