Skip to content

Commit 053861d

Browse files
committed
Avoid false positive in Elixir v1.19
1 parent 671042c commit 053861d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/phoenix_html/engine.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ defmodule Phoenix.HTML.Engine do
146146
# We need to check at runtime and we do so by optimizing common cases.
147147
defp to_safe(expr, line) do
148148
# Keep stacktraces for protocol dispatch and coverage
149+
# bin_return uses generated: true to make Elixir's type system on v1.19 happy
149150
safe_return = quote line: line, do: data
150-
bin_return = quote line: line, do: Phoenix.HTML.Engine.html_escape(bin)
151+
bin_return = quote line: line, generated: true, do: Phoenix.HTML.Engine.html_escape(bin)
151152
other_return = quote line: line, do: Phoenix.HTML.Safe.to_iodata(other)
152153

153154
# However ignore them for the generated clauses to avoid warnings

0 commit comments

Comments
 (0)