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


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="michallepicki" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  michallepicki
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I spent some time debugging and the second, more helpful warning is correctly detected by Dialyzer but not added to list of warnings because Elixir is not generating the Erlang AST as nicely as Dialyzer expects it to be. (Line numbers are missing for literals (are set to 0), and other nodes as well, which makes them be interpreted as generated and Dialyzer decides not to add a warning at all because it would be confusing to point to line number 0).</p>
<p>More concretely, this happens because for the <code>1</code> integer literal at line 3 Elixir generates something that later is seen by Dialyzer as:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">{c_literal,[0,{file,"0"}],1}
</code></pre>
<p>so it has line number set to 0 so returns <code>is_generated</code> <code>true</code> <a href="https://github.com/erlang/otp/blob/d7f19868551b10d6f0be48ff1d76626676a4a2aa/lib/dialyzer/src/dialyzer_dataflow.erl#L3160" rel="noopener nofollow ugc">here</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="218992" 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-ls-not-showing-warnings/40741/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-218992" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="218992"
                     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 #11"></div>
  </section>
</div>
    <div class="postbit" id="218994" data-post-id="218994">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="michallepicki" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  michallepicki
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>In case of the previous issue I discovered with Elixir &lt;&gt; Dialyzer integration, the root cause was the same - Elixir setting location to 0 for some forms. Erlang to pick the line number was trying to pick the lowest number in the AST, so when some of forms inside the tree had it set to 0, 0 was being picked.</p>
<p>It was fine to “fix” it on the Erlang side, because it didn’t require much hassle (my fix was just a 1 line change, but the Erlang/OTP team decided to merge an alternative PR with a small cleanup as well).</p>
<p>At this point, after discovering this second issue that has the same root cause, I believe Elixir should be a better BEAM citizen and generate Erlang AST that integrates more nicely with the tooling, by correctly adding code location where it can (it would just require passing down location in a few places in the compiler).</p>
<p>Someone should open an issue in the Elixir repo to see what the Elixir team thinks, (I am spending enough time on making Elixir work well with Dialyzer already <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"> )</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="218994" data-batch-url="/posts/batch_likers">
                        4
                      </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-ls-not-showing-warnings/40741/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-218994" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="218994"
                     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 #12"></div>
  </section>
</div>
    <div class="postbit" id="219045" data-post-id="219045">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lud" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lud/120/14382_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lud
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I would be glad to create that issue but I really don’t know how what I would say.</p>
<p>I ran this code:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule MyApp do
  def hello do
    default(11_111_111)
  end

  @spec default(binary) :: binary
  def default(bin) when is_binary(bin) do
    "test #{bin}"
  end

  def debug do
    __MODULE__
    |&gt; :code.which()
    |&gt; :beam_lib.chunks([:debug_info])
    |&gt; IO.inspect(label: "debug")
  end
end
</code></pre>
<p>And it gave me the following result:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">:ok,                                                                                                                                                                                                               
 {MyApp,                                                                                                                                                                                                            
  [                                                                                                                                                                                                                 
    debug_info: {:debug_info_v1, :elixir_erl,                                                                                                                                                                       
     {:elixir_v1,                                                                                                                                                                                                   
      %{                                                                                                                                                                                                            
        attributes: [],                                                                                                                                                                                             
        compile_opts: [],                                                                                                                                                                                           
        definitions: [                                                                                                                                                                                              
          {{:hello, 0}, :def, [line: 2],                                                                                                                                                                            
           [{[line: 2], [], [], {:default, [line: 3], [11111111]}}]},                                                                                                                                               
          {{:default, 1}, :def, [line: 7],                                                                                                                                                                          
           [                                                                                                                                                                                                        
             {[line: 7], [{:bin, [version: 0, line: 7], nil}],                                                                                                                                                      
              [                                                                                                                                                                                                     
                {{:., [line: 7], [:erlang, :is_binary]}, [line: 7],                                                                                                                                                 
                 [{:bin, [version: 0, line: 7], nil}]}                                                                                                                                                              
              ],                                                                                                                                                                                                    
              {:&lt;&lt;&gt;&gt;, [alignment: 0, line: 8],
               [
                 {:"::", [inferred_bitstring_spec: true, line: 8],
                  ["test ", {:binary, [line: 8], []}]},
                 {:"::", [line: 8],
                  [
                    {{:., [line: 8], [String.Chars, :to_string]}, [line: 8],
                     [{:bin, [version: 0, line: 8], nil}]},
                    {:binary, [], []}
                  ]}
               ]}}
           ]},
          {{:debug, 0}, :def, [line: 11],
           [
             {[line: 11], [], [],
              {{:., [line: 15], [IO, :inspect]}, [line: 15],
               [
                 {{:., [line: 14], [:beam_lib, :chunks]}, [line: 14],
                  [
                    {{:., [line: 13], [:code, :which]}, [line: 13], [MyApp]},
                    [:debug_info]
                  ]},
                 [label: "debug"]
               ]}}
           ]}
        ],

 # ...
</code></pre>
<p>I do not have knowledge about the compiler but to me it looks like the line numbers are set.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="219045" 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-ls-not-showing-warnings/40741/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-219045" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="219045"
                     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 #13"></div>
  </section>
</div>
    <div class="postbit" id="219047" data-post-id="219047">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="michallepicki" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  michallepicki
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi, I think describing that Dialyzer is not showing some of warnings for Elixir code since Erlang 24 and linking to this thread is enough <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"> In your code snippet there is Elixir’s AST, and Elixir does not store line number for some (all?) literals at all. so <code>11111111</code> is just represented directly. The fix would be to ensure that the line <code>3</code> from the context gets passed down as this tree is being translated to Erlang forms and eventually makes its way to Ann <a href="https://github.com/elixir-lang/elixir/blob/bfb1b0f4fb687ecec0a9ddaaf391343cb0fbb96b/lib/elixir/src/elixir_erl.erl#L83" rel="noopener nofollow ugc">here</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="219047" 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-ls-not-showing-warnings/40741/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-219047" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="219047"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-solved cat-solved" title="Marked as solution"></div>
  </section>
</div>
    <div class="postbit" id="219201" data-post-id="219201">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lud" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lud/120/14382_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lud
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a href="https://github.com/elixir-lang/elixir/issues/11107" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/elixir-lang/elixir/issues/11107</a></p>
<p>I will try 24.0.3 and hopefully get some of those lovely warnings back.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="219201" 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-ls-not-showing-warnings/40741/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-219201" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="219201"
                     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 #15"></div>
  </section>
</div>
    <div class="postbit" id="220161" data-post-id="220161">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="lukaszsamson" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lukaszsamson/120/7671_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  lukaszsamson
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>ElixirLS Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Just for the record the elixir part of that issue will not likely be fixed on 1.12 patch <a href="https://github.com/elixir-lang/elixir/commit/49bac68affd2e94bda704d6207b6a34cd4f07e76#commitcomment-53566800" class="inline-onebox" rel="noopener nofollow ugc">Pass annotation to arguments, closes #11107 · elixir-lang/elixir@49bac68 · GitHub</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="220161" 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-ls-not-showing-warnings/40741/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-220161" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="220161"
                     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>