Skip to content

Conversation

dkulchenko
Copy link
Contributor

EEx.compile_string/2 was passing all options to tokenize/2, but tokenize/2 only accepts tokenize_opt (:file, :line, :column, :indentation, :trim). This caused dialyzer to correctly flag calls with :engine or :parser_options as type errors in Elixir 1.19+.

The fix filters options before passing to tokenize/2, keeping only the valid tokenize_opt keys, while still passing the full options list to EEx.Compiler.compile/3 which needs :engine, :parser_options, and custom engine options.

Fixes #14834

EEx.compile_string/2 was passing all options to tokenize/2, but
tokenize/2 only accepts tokenize_opt (:file, :line, :column,
:indentation, :trim). This caused dialyzer to correctly flag calls
with :engine or :parser_options as type errors in Elixir 1.19+.

The fix filters options before passing to tokenize/2, keeping only
the valid tokenize_opt keys, while still passing the full options
list to EEx.Compiler.compile/3 which needs :engine, :parser_options,
and custom engine options.

Fixes elixir-lang#14834
@josevalim josevalim merged commit 53fb96c into elixir-lang:main Oct 16, 2025
13 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

josevalim pushed a commit that referenced this pull request Oct 16, 2025
EEx.compile_string/2 was passing all options to tokenize/2, but
tokenize/2 only accepts tokenize_opt (:file, :line, :column,
:indentation, :trim). This caused dialyzer to correctly flag calls
with :engine or :parser_options as type errors in Elixir 1.19+.

The fix filters options before passing to tokenize/2, keeping only
the valid tokenize_opt keys, while still passing the full options
list to EEx.Compiler.compile/3 which needs :engine, :parser_options,
and custom engine options.

Fixes #14834
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.

EEx typings mismatch causing dialyzer errors on 1.19

2 participants