lud
Hi,
I guess I do not understand how ElixirLS works.
Test code:
defmodule MyApp do
def hello do
default(1)
end
@spec default(binary) :: binary
def default(bin) when is_binary(bin) do
"test #{bin}"
end
end
Output:
Started ElixirLS v0.7.0
Elixir version: "1.12.1 (compiled with Erlang/OTP 24)"
Erlang version: "24"
ElixirLS compiled with Elixir 1.8.2 and erlang 21
Now I understand that there is a version mismatch but the vscode extension comes with precompiled beam files, so how could the version be the same?
Dialyzer (ran with dialyxir) succesfully reports the error, but ElixirLS is not showing the yellow vvvvvv. It should show that Function hello/0 has no local return.
What should I check now to make it work?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m aware of 2 such projects, are there others?
git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
Hi all,
I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
How do I tell Hologram not to escape HTML when substituting into templates?
{Textile.render(@product.long_description)}
escapes the HTM...
New
I’d like to create a file with 600 permissions (rw-------), but there’s a race condition if I create it and then change the permissions. ...
New
Hi,
we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
When I use Mix.install with a git dependency, using git@github.com:... how do I change the SSH identity used?
I’ve got two Github accoun...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #elixirconf-us
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #security
- #elixirconf-eu
- #api
- #forms
- #performance










Showing Posts 16 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
lukaszsamson
Just for the record the elixir part of that issue will not likely be fixed on 1.12 patch Pass annotation to arguments, closes #11107 · elixir-lang/elixir@49bac68 · GitHub
lud
https://github.com/elixir-lang/elixir/issues/11107
I will try 24.0.3 and hopefully get some of those lovely warnings back.
michallepicki
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
In your code snippet there is Elixir’s AST, and Elixir does not store line number for some (all?) literals at all. so
11111111is just represented directly. The fix would be to ensure that the line3from the context gets passed down as this tree is being translated to Erlang forms and eventually makes its way to Ann herelud
I would be glad to create that issue but I really don’t know how what I would say.
I ran this code:
And it gave me the following result:
I do not have knowledge about the compiler but to me it looks like the line numbers are set.
michallepicki
In case of the previous issue I discovered with Elixir <> 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.
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).
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).
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
)
michallepicki
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).
More concretely, this happens because for the
1integer literal at line 3 Elixir generates something that later is seen by Dialyzer as:so it has line number set to 0 so returns
is_generatedtruehereSebb
can confirm that there are no warnings with erlang 24.0 and 24.0.2. But still there is a warning missing for 24.0.3
michallepicki
I think Elixir version doesn’t make a difference, to reproduce just use
erlang 24.0(without any patches) orerlang 24.0.2and there will be no warnings shown. Dialyzer returnsso this is probably related to Fix lost line numbers in Dialyzer warnings for Elixir code by michallepicki · Pull Request #4890 · erlang/otp · GitHub. With
24.0.3I also see only one warning.Sebb
I can partially reproduce with OTP 22 and 24 (switched between these 3 times and always the same behaviour). 22 shows both warnings, 24 only one.
also showing both:
Which Elixir version?
EDIT:
I installed erlang 24.0. and can confirm, that I also do not get any warnings displayed.
Also the output of ElixirLS differs.
Output with 24.0.3:
Output with 24.0:
michallepicki
I can see the issue with Erlang 24.0. Switching to Erlang 24.0.3 fixes it.