Open bartblast opened 1 week ago
PS: the last working Elixir version that I tested on is 1.16.3-otp-26 (1.17.0 doesn't work either).
Hello Bart, thanks for reporting. I will start next week to test and fix beam_file
to work with Elixir 1.17. The package always needs some updates for any new Elixir version.
Got ya, thanks a lot!
Hello @bartblast , I have released version 0.6.1. Can you please check if that fixes this issue.
The problem was that the BeamFile.Normalizer
expanded :utf8
to {:__block__, [], [:utf8]}
. That is needed for Elixir 1.13 and when the normalised AST goes to the Elixir formatter, without the change the formatter throws an error (I don't know why). In the released version this "normalisation" step is restricted to Elixir 1.13 and the function elixir_code
.
Hey Marcus, after upgrading to Elixir 1.17.1 I started noticing invalid output from elixir_quoted/1.
Here's the result of BeamFile.elixir_quoted!(Collectable.HashDict) call in Elixir 1.17.1:
Notice how the args of :erlang.binary_to_atom/2 call are encoded:
["HashDict", {:__block__, [], [:utf8]}],
I suppose this should be["HashDict", :utf8]
.Here's the result of BeamFile.debug_info!(Collectable.HashDict) call:
And here's the original Elixir code for the corresponding protocol implementation:
(https://github.com/elixir-lang/elixir/blob/0793fc91b992ba1e3acbe5a1286a5259bb97bcf0/lib/elixir/lib/hash_dict.ex#L286C1-L299C4)