Skip to content

Conversation

@sabiwara
Copy link
Contributor

Closes #14927

I'm starting to dislike these fixes, especially because Dialyzer is unable to follow the real types of functions like Keyword.pop. No matter what function we call, returning a keyword will be enough for Dialyzer to give up checking keys altogether.

Calling Keyword.take before each call doesn't seem great, there's an extra performance cost for no reason since these functions don't care about the extra opts.
We might as well define "open keyword" types, like we do for format_opts (| {atom(), term()}), which correspond better to the real types of these functions (the downside is we can't catch typos in opts).

@sabiwara sabiwara force-pushed the format-string-dialyzer branch from 43b6976 to e710ace Compare November 20, 2025 00:02
locals_without_parens: true,
migrate: true
)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, we can probably add the IO.inspect one here too!

@josevalim
Copy link
Member

Please back port it too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Dialyzer error on Code.format_string! in 1.19

2 participants