Credence.Semantic.UndefinedFunction (credence v0.4.4)

Copy Markdown

Fixes compiler warnings about undefined or deprecated functions with known replacements.

LLMs sometimes use functions that don't exist in the expected module or have been deprecated in favour of a replacement. This rule maintains a mapping of known corrections.

Examples

# Warning: Enum.last/1 is undefined or private
list |> Enum.last()
# Fixed:
list |> List.last()

# Warning: Enum.partition/2 is deprecated. Use Enum.split_with/2 instead
Enum.partition(list, &pred/1)
# Fixed:
Enum.split_with(list, &pred/1)