I’m currently migrating my codebase to Elixir 1.18.2. I was able to solve all the typing issues, except for one. The following code:
defmodule Run do
def test do
try do
Code.compile_string("a + ")
rescue
e ->
case e do
%{column: column, snippet: %{offset: offset}} ->
{:error, column + offset}
_ ->
{:error, :unknown}
end
end
end
end
Gives me the following compilation warning:
This could be solved by adding guards, that will allow for infering the types in a future release. But at the moment I’m not able to migrate this code and there is no scapehatch for it.