Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/eq/dsl/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ defmodule Funx.Eq.Dsl.Parser do
{:__aliases__, meta, _} = module_alias ->
# Try to parse as behaviour module
expanded_module = Macro.expand(module_alias, caller_env)
Code.ensure_compiled(expanded_module)

if function_exported?(expanded_module, :eq, 1) do
parse_bare_behaviour_module(module_alias, [], meta, caller_env)
Expand All @@ -114,6 +115,7 @@ defmodule Funx.Eq.Dsl.Parser do
# Parses a bare behaviour module reference into a Step node.
defp parse_bare_behaviour_module(module_alias, opts, meta, caller_env) do
expanded_module = Macro.expand(module_alias, caller_env)
Code.ensure_compiled(expanded_module)

unless function_exported?(expanded_module, :eq, 1) do
raise CompileError,
Expand Down Expand Up @@ -366,6 +368,7 @@ defmodule Funx.Eq.Dsl.Parser do
end

expanded_module = Macro.expand(module_alias, caller_env)
Code.ensure_compiled(expanded_module)

cond do
function_exported?(expanded_module, :eq?, 2) ->
Expand Down
1 change: 1 addition & 0 deletions lib/ord/dsl/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ defmodule Funx.Ord.Dsl.Parser do
end

expanded_module = Macro.expand(module_alias, caller_env)
Code.ensure_compiled(expanded_module)

cond do
function_exported?(expanded_module, :lt?, 2) ->
Expand Down
2 changes: 2 additions & 0 deletions lib/predicate/dsl/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ defmodule Funx.Predicate.Dsl.Parser do
{:__aliases__, meta, _} = module_alias ->
# Try to parse as behaviour module
expanded_module = Macro.expand(module_alias, caller_env)
Code.ensure_compiled(expanded_module)

if function_exported?(expanded_module, :pred, 1) do
parse_behaviour_module(module_alias, [], meta, caller_env)
Expand All @@ -163,6 +164,7 @@ defmodule Funx.Predicate.Dsl.Parser do

defp parse_behaviour_module(module_alias, opts, meta, caller_env) do
expanded_module = Macro.expand(module_alias, caller_env)
Code.ensure_compiled(expanded_module)

unless function_exported?(expanded_module, :pred, 1) do
raise CompileError,
Expand Down