Skip to content

Commit

Permalink
Fix: Elixir 1.16 Protocols
Browse files Browse the repository at this point in the history
fixes atomvm#1022

Signed-off-by: Peter M <[email protected]>
  • Loading branch information
petermm committed Feb 1, 2024
1 parent f26a643 commit f4bee3f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion libs/exavmlib/lib/Code.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# This file is part of AtomVM.
#
# Copyright 2021 Davide Bettio <[email protected]>
# Copyright 2024 Davide Bettio <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -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 f4bee3f

Please sign in to comment.