Credence.Semantic.NoUnderscoreInExpression
(credence v0.8.0)
Copy Markdown
Fixes compiler errors caused by using _ in expression position,
such as a tuple key in a for-comprehension body.
The Elixir compiler rejects _ in expression position:
for _ <- 0..(n - 1), into: %{} do
{_, :infinity} # ← error: invalid use of _
endThe fix renames the _ generator to a fresh variable (idx)
and updates all references in the comprehension body:
for idx <- 0..(n - 1), into: %{} do
{idx, :infinity}
end