Skip to content

test: ?? on an Option evaluates in a build.w (#1041) - #2673

Merged
ehartford merged 1 commit into
fix-1052from
fix-1041
Oct 25, 2026
Merged

ehartford merged 1 commit into
fix-1052from
fix-1041

Conversation

@ehartford

@ehartford ehartford commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

The build evaluator is ComptimeEval; its eval_binary sent OP_DEFAULT to the
integer operators ("operator requires integer comptime values"). The #2386
layer of this stack gave it ?? over an Option (the Some's payload, else
the fallback, evaluated only for a None); match on an Option already
evaluated.

Test: test/behavior/behav_1041_build_w_option_default.w runs a project whose
build.w computes v.pop() ?? 7 on an empty and a one-element List. With the
installed compiler: "build.w:4:16: operator requires integer comptime
values; reached through __with_build_eval_entry -> build".

Closes #1041

The build evaluator is ComptimeEval; its eval_binary sent OP_DEFAULT to the
integer operators ("operator requires integer comptime values"). The #2386
layer of this stack gave it `??` over an Option (the Some's payload, else
the fallback, evaluated only for a None); `match` on an Option already
evaluated.

Test: test/behavior/behav_1041_build_w_option_default.w runs a project whose
build.w computes `v.pop() ?? 7` on an empty and a one-element List. With the
installed compiler: "build.w:4:16: operator requires integer comptime
values; reached through __with_build_eval_entry -> build".
@ehartford
ehartford added this pull request to stack #2678 October 25, 2026 22:52
@ehartford ehartford changed the title fix 1041 test: ?? on an Option evaluates in a build.w (#1041) Oct 25, 2026
@ehartford
ehartford marked this pull request as ready for review October 25, 2026 23:05
@ehartford
ehartford merged commit 1bc2aa5 into main Oct 25, 2026
@ehartford
ehartford deleted the fix-1041 branch October 25, 2026 23:05
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.

Comptime build.w evaluator: ?? on an Option is not evaluable (match is)

1 participant