Credence.Semantic.UndefinedStringAlphanumeric
(credence v0.4.4)
Copy Markdown
Fixes the common LLM hallucination where String.alphanumeric?/1 is called
as if it were a real Elixir standard library function. It is not.
LLMs translating Python's str.isalnum() frequently produce:
Enum.filter(&String.alphanumeric?/1)This compiles but warns String.alphanumeric?/1 is undefined or private,
which becomes a hard error under --warnings-as-errors.
The fix replaces:
&String.alphanumeric?/1→fn char -> String.match?(char, ~r/^[a-zA-Z0-9]$/) endString.alphanumeric?(expr)→String.match?(expr, ~r/^[a-zA-Z0-9]$/)