Credence.Semantic.UndefinedLocalFunction
(credence v0.5.0)
Copy Markdown
Fixes compiler errors about undefined local functions with known replacements.
LLMs sometimes hallucinate local functions that don't exist in Elixir, often translating idioms from other languages. This rule maintains a mapping of known corrections.
Literal example (arity-0 call → replacement text)
# Error: undefined function infinity/0
Enum.reduce(nums, {-infinity(), -infinity()}, fn ...)
# Fixed:
Enum.reduce(nums, {-:math.inf(), -:math.inf()}, fn ...)Rename example (bare call → qualified call)
# Error: undefined function max/1
max([option1, option2])
# Fixed:
Enum.max([option1, option2])