Credence.Semantic.UndefinedFunction (credence v0.6.0)

Copy Markdown

Fixes compiler diagnostics about undefined, private, or deprecated functions.

Handles both module-qualified calls (Module.function) from compiler warnings and bare local calls (function) from compiler errors. Maintains hardcoded replacement maps for known patterns, with a FunctionMatcher fallback for unknown functions.

Replacement types

Qualified (module-prefixed):

{:rename, mod, fun}                    swap Module.function, keep args
{:literal, text}                       replace Module.function() with literal
{:literal_with_neg, pos, neg}          literal, negation-aware
{:rename_add_arg, mod, fun, arg}       rename + append extra argument
{:rename_negate_arg, mod, fun, index}  rename + negate argument at index

Local (bare calls):

{:literal, text}          replace name() with text
{:rename, mod, fun}       replace name( with mod.fun(
{:rename_local, new}      replace name( with new(
{:wrap_args, mod, fun}    replace name(a,b,c) with mod.fun([a,b,c])
:to_range                 replace range(...) with Elixir range literal