Skip to content

fix: spell builtin variants in expressions with the dot form - #5

Closed
slepp wants to merge 2 commits into
mainfrom
feat/bare-variant-expr
Closed

slepp wants to merge 2 commits into
mainfrom
feat/bare-variant-expr

Conversation

@slepp

@slepp slepp commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Why

Hew refuses bare Some, None, Ok and Err in expression position (hew-lang/hew#3240), and a block at the start of a statement now ends at its closing brace, so the packages stop type-checking on a compiler that carries these rules.

What

Each bare constructor becomes the checker's fix-it: .Ok(x) where the expected type selects the enum, Result.Ok(x) where nothing does. The unsafe block compared in nats has_reply is parenthesized.

Test

scripts/corpus-gate.sh check passes with a compiler carrying the rules; verify_package_contract.py and verify-pins.sh pass.

Bare Some, None, Ok and Err in expression position are refused from Hew
v0.6.0; the packages use .Ok(x) where the expected type selects the enum
and Result.Ok(x) where nothing does.
A block at the start of a statement now ends at its closing brace, so
using its value as an operand needs parentheses.
@slepp

slepp commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

Absorbed by #6, which moves every package onto the rc4 surface and replaces the close handlers these hunks touched.

@slepp slepp closed this Sep 30, 2026
@slepp
slepp deleted the feat/bare-variant-expr branch September 30, 2026 19:15
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.

1 participant