diff --git a/libs/exavmlib/lib/Code.ex b/libs/exavmlib/lib/Code.ex index f18f62dba..bb759a1eb 100644 --- a/libs/exavmlib/lib/Code.ex +++ b/libs/exavmlib/lib/Code.ex @@ -1,7 +1,7 @@ # # This file is part of AtomVM. # -# Copyright 2021 Davide Bettio +# Copyright 2024 Davide Bettio # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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