<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="390222" data-post-id="390222">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="NobbZ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/NobbZ/120/27235_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  NobbZ
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Awlexus" data-post="32" data-topic="75566">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/awlexus/48/12355_2.png" class="avatar"> Awlexus:</div>
<blockquote>
<p>The content of the warning is correct, but it is referencing the wrong file. <code>Themes.ThemeName</code> embeds a few components using <code>embed_templates("theme_name/*")</code> (<a href="https://phoenix-live-view.hexdocs.pm/Phoenix.Component.html#embed_templates/2" rel="nofollow">Phoenix.Component.embed_templates/2</a>) and the actual problem in this case is in <code>lib/themes/theme_name/pagination.html.heex</code>.</p>
</blockquote>
</aside>
<p>This is probably nothing elixir can do something about. It is very likely that the implementation of <code>embed_templates/2</code> is missing to insert some <a href="https://elixir.hexdocs.pm/1.20.1/Module.html#module-file" rel="nofollow"><code>@file</code></a>.</p>
<p>Or if they exist, <em>then</em> we could argue whether not respecting them was a bug in the typechecker.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="390222" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-v1-20-0-released/75566/33">Post #32</a>
	                </div>
	            </div>
              <div id="likers-container-390222" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="390222"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #32"></div>
  </section>
</div>
    <div class="postbit" id="390223" data-post-id="390223">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Awlexus" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Awlexus/120/12355_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Awlexus
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="NobbZ" data-post="33" data-topic="75566">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/nobbz/48/27235_2.png" class="avatar"> NobbZ:</div>
<blockquote>
<p>This is probably nothing elixir can do something about. It is very likely that the implementation of <code>embed_templates/2</code> is missing to insert some <a href="https://elixir.hexdocs.pm/1.20.1/Module.html#module-file" rel="noopener nofollow ugc"><code>@file</code></a>.</p>
</blockquote>
</aside>
<p>Thanks for the confirmation. I’m not that confident with macros, but I’ll take a look in the code in Phoenix LiveView</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="390223" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-v1-20-0-released/75566/34">Post #33</a>
	                </div>
	            </div>
              <div id="likers-container-390223" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="390223"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #33"></div>
  </section>
</div>
    <div class="postbit" id="390224" data-post-id="390224">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>That would be most likely an Elixir bug. I did a quick attempt to reproduce it and failed, so if you can isolate it into a small app, it would help a lot!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="390224" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-v1-20-0-released/75566/35">Post #34</a>
	                </div>
	            </div>
              <div id="likers-container-390224" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="390224"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #34"></div>
  </section>
</div>
    <div class="postbit" id="390226" data-post-id="390226">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Awlexus" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Awlexus/120/12355_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Awlexus
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>As with all things in life, the situation turned out more complex than expected.</p>
<p>Basically we have multiple themes and in order to ensure that each theme implements the same components and interfaces we created a file <code>lib/themes/impl.ex</code> where we defined function headers and attribute for the components. For example.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"># themes/impl.ex
defmodule Themes.Impl do
  defmacro __using__(_) do
    quote do
      use Phoenix.Component

      attr :total_pages, :string, default: nil
      attr :current_page, :string, default: nil
      slot :inner_block
      def pagination(assigns)
    end
  end
end


# themes/theme_name.ex
defmodule Themes.ThemeName do
  use Themes.Impl

  embed_templates("theme_name/*")
end
</code></pre>
<p>I invested the issue with help from claude and found out the root cause is that elixir only considers the file (<code>@file</code>) of the first function clause.</p>
<h3><a name="p-390226-minimal-reproduction-1" class="anchor" href="#p-390226-minimal-reproduction-1" aria-label="Heading link" rel="nofollow"></a>Minimal reproduction</h3>
<p>write this into a .exs file and run it</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Bug do
  def render(x)

  @file "template.heex"
  def render(x) do
    label = describe(x)
    _ = label == :only
    x
  end

  defp describe(_), do: "page"
end
</code></pre>
<h3><a name="p-390226-error-message-2" class="anchor" href="#p-390226-error-message-2" aria-label="Heading link" rel="nofollow"></a>Error message</h3>
<pre data-code-wrap="elixir"><code class="lang-elixir">    warning: comparison between distinct types found:

        label == :only

    given types:

        binary() == :only

    where "label" was given the type:

        # type: binary()
        # from: repro.exs:16:11
        label = describe(x)

    While Elixir can compare across all types, you are comparing across types which are always disjoint, and the result is either always true or always false

    typing violation found at:
    │
 17 │     _ = label == :only
    │               ~
    │
    └─ repro.exs:17:15: Bug.render/1 # Should have been template.heex
</code></pre>
<p><strong>Note</strong>: This is also reproducible in 1.19.5</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="390226" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-v1-20-0-released/75566/36">Post #35</a>
	                </div>
	            </div>
              <div id="likers-container-390226" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="390226"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #35"></div>
  </section>
</div>
    <div class="postbit" id="390237" data-post-id="390237">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Fantastic. A fix will be pushed to main and v1.20 as soon as tests pass locally!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="390237" data-batch-url="/posts/batch_likers">
                        5
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/elixir-v1-20-0-released/75566/37">Post #36</a>
	                </div>
	            </div>
              <div id="likers-container-390237" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="390237"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>