Skip to content

Fix Join.escape/3 and quoted_type specs - #4804

Merged
josevalim merged 1 commit into
elixir-ecto:masterfrom
lukaszsamson:fix-builder-specs
Oct 19, 2026
Merged

josevalim merged 1 commit into
elixir-ecto:masterfrom
lukaszsamson:fix-builder-specs

Conversation

@lukaszsamson

Copy link
Copy Markdown
Contributor

Found with SpecLint on elixir 1.20.4

lib/ecto/query/builder/join.ex:47: warning: Ecto.Query.Builder.Join.escape/3: inferred return includes {atom(), term(), term(), term(), term()}, which the spec does not declare
    @spec escape(Macro.t(), Keyword.t(), Macro.Env.t()) ::
  {atom(), Macro.t() | nil, Macro.t() | nil, list()}
    inferred: ({:in, term(), non_empty_list(term())}, term(), term()) -> dynamic({atom(), term(), term(), term(), term()})
    inferred: ({:^ or :subquery, term(), non_empty_list(term())}, term(), term()) -> dynamic({:_, term(), nil, nil, empty_list()})
    inferred: ({:fragment, term(), non_empty_list(term(), term())}, term(), term()) -> dynamic({:_, term(), nil, nil, term()})
    inferred: ({:values, term(), non_empty_list(term())}, term(), term()) -> dynamic({:_, {:{}, empty_list(), non_empty_list(:values or list(term()))}, nil, term(), term()})
    inferred: (({...} and not {binary(), term()} and ... ) -> dynamic()
    inferred: ({:assoc, term(), non_empty_list(term())}, term(), term()) -> dynamic({:_, nil, {term(), term()}, nil, empty_list()})
    inferred: (binary(), term(), term()) -> dynamic({:_, {binary(), nil}, nil, nil, empty_list()})
    inferred: (atom(), term(), term()) -> dynamic({:_, {nil, atom()}, nil, nil, empty_list()})
lib/ecto/query/builder.ex:1430: warning: Ecto.Query.Builder.quoted_type/2: inferred return includes :atom or {:tuple, term()}, which the spec does not declare
    @spec quoted_type(Macro.t(), Keyword.t()) :: quoted_type()
    ... (14 clauses with returns already in the spec, omitted) ...
    inferred: (atom() and not(boolean(), nil), term()) -> :atom
    inferred: ({:{}, term(), term()}, term()) -> dynamic({:tuple, term()})
    ... (1 more clause, returns :any) ...
spec_lint: 10 spec clauses checked, 0 error(s), 2 warning(s)

@josevalim
josevalim merged commit 8760894 into elixir-ecto:master Oct 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants