Skip to content

Commit

Permalink
Merge pull request atomvm#1023 from petermm/fix-1022
Browse files Browse the repository at this point in the history
Fix: Elixir 1.16 Protocols

fixes atomvm#1022 - tested on device (esp32)

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
  • Loading branch information
bettio committed Feb 1, 2024
2 parents bed726e + 2076747 commit 218ddbf
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 with 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 218ddbf

Please sign in to comment.