diff --git a/lib/ex_type/custom_env.ex b/lib/ex_type/custom_env.ex index f5de351..d950c3e 100644 --- a/lib/ex_type/custom_env.ex +++ b/lib/ex_type/custom_env.ex @@ -111,6 +111,13 @@ defmodule ExType.CustomEnv do new_alias = {:__aliases__, meta, new_alias_prefix ++ tokens} + # Manually expand `alias __MODULE__`, see https://github.com/gyson/ex_type/issues/27 + block = block + |> Macro.prewalk(fn + {:alias, meta_alias, [{:__MODULE__, meta_module, nil}]} -> {:alias, meta_alias, [{:__aliases__, meta_module, tokens}]} + token -> token + end) + # Manually expand `alias __MODULE__`, see https://github.com/gyson/ex_type/issues/27 block = block |> Macro.prewalk(fn