Skip to content

Commit

Permalink
Fix: Elixir 1.16 Protocols
Browse files Browse the repository at this point in the history
Signed-off-by: Peter M <[email protected]>
  • Loading branch information
petermm committed Feb 1, 2024
1 parent bed726e commit 51e483a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions libs/exavmlib/lib/Code.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,24 @@

defmodule Code do
@compile {:autoload, false}
@moduledoc """
This module is to satisfy certain code loading checks in Elixir,
specifically with regards to protocols support.
The functions are noop, and doesn't perform the actual checks,
as they are not relevant on AtomVM.
"""

@doc """
required for protocols to work Elixir >= 1.16, due to code loading checks.
"""
def ensure_compiled(module) do
{:module, module}
end

@doc """
previously required for protocols support, due to code loading checks.
"""
@deprecated "Use Code.ensure_compiled/1 instead"
def ensure_compiled?(_) do
true
end
Expand Down

0 comments on commit 51e483a

Please sign in to comment.