Skip to content

comptime: a list comprehension is comptime-evaluable (#2142) - #2151

Merged
ehartford merged 1 commit into
fix-2134-on-stackfrom
fix-2142-comptime-comprehension
Oct 5, 2026
Merged

ehartford merged 1 commit into
fix-2134-on-stackfrom
fix-2142-comptime-comprehension

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

[expr for pat in iter … if cond] evaluates at comptime: over a range, an array or a vec, with a filter and with nested clauses. It was "expression kind 64 is not comptime-evaluable yet". README's squares becomes comptime fn squares(n: i32): [i * i for i in 0..n] and const SQUARES = comptime squares(8) (both inferred forms verified). Test: behav_2142_comptime_comprehension.

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