Skip to content

Allow empty list in Normalizer.to_codepoints/1 spec - #61

Merged
kipcole9 merged 1 commit into
elixir-localize:mainfrom
lukaszsamson:fix-to-codepoints-spec
Oct 22, 2026
Merged

kipcole9 merged 1 commit into
elixir-localize:mainfrom
lukaszsamson:fix-to-codepoints-spec

Conversation

@lukaszsamson

Copy link
Copy Markdown
Contributor

Found with SpecLint on elixir 1.20.4

lib/localize/collation/normalizer.ex:58: warning: Localize.Collation.Normalizer.to_codepoints/1: inferred return includes (non_empty_list(term(), term()) and not non_empty_list(integer())) or empty_list(), which the spec does not declare
    @spec to_codepoints(String.t()) :: [non_neg_integer(), ...]
    inferred: (binary()) -> dynamic(empty_list() or non_empty_list(term(), term()))

Localize.Collation.Normalizer.to_codepoints("") #=> [], but the spec declared a non-empty list. The spec is now [non_neg_integer()].

@kipcole9
kipcole9 merged commit c818af9 into elixir-localize:main Oct 22, 2026
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