Credence.Semantic.NoBareNamesInSpec
(credence v0.8.0)
Copy Markdown
Fixes compiler errors about undefined types caused by bare names in @spec.
When an LLM generates a @spec with bare parameter names (e.g., sub_list)
instead of properly annotated parameters (e.g., sub_list :: any()), the
Elixir compiler interprets those bare names as type references and emits:
type sub_list/0 undefined (no such type in Module)This rule detects that diagnostic and rewrites the bare name into an
annotated parameter with :: any() so the spec compiles.