diff --git a/lib/algae/internal.ex b/lib/algae/internal.ex index 431c3b8..dc06f5b 100644 --- a/lib/algae/internal.ex +++ b/lib/algae/internal.ex @@ -253,7 +253,7 @@ defmodule Algae.Internal do def default_value({{:., _, [{_, _, adt}, :t]}, _, []}) do quote do if Kernel.function_exported?(unquote(Module.concat(adt)), :new, 0) do - unquote(Module.concat(adt)).new() + apply(Module.concat(adt), :new, []) else nil end @@ -263,7 +263,7 @@ defmodule Algae.Internal do def default_value({{:., _, [module, :t]}, _, []}) do quote do if Kernel.function_exported?(unquote(module), :new, 0) do - unquote(module).new() + apply(unquote(module), :new, []) else nil end