Skip to content

Commit 3691d54

Browse files
committed
Merge pull request #1736 from bettio/fix-build-with-elixir-v1.19
Fix build with Elixir >= v1.19 These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 27086e4 + 9ec401c commit 3691d54

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libs/exavmlib/lib/ErlangError.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
defmodule ErlangError do
2323
# This avoids crashing the compiler at build time
2424
@compile {:autoload, false}
25+
@compile {:no_warn_undefined, BadStructError}
2526

2627
defexception [:original]
2728

@@ -56,7 +57,9 @@ defmodule ErlangError do
5657
end
5758

5859
def normalize({:badstruct, struct, term}, _stacktrace) do
59-
%BadStructError{struct: struct, term: term}
60+
# starting from v1.19.0, BadStructError is not available
61+
# still older Elixir versions might need it
62+
BadStructError.__struct__(%{struct: struct, term: term})
6063
end
6164

6265
def normalize({:badmatch, term}, _stacktrace) do

0 commit comments

Comments
 (0)