Skip to content

Commit a896e4e

Browse files
authored
Merge pull request #123 from naserca/remove-alias-expansion-warning
Remove warning when aliases cannot be expanded
2 parents e84dea0 + 222163f commit a896e4e

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

lib/polymorphic_embed.ex

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ defmodule PolymorphicEmbed do
33

44
@type t() :: any()
55

6-
require Logger
76
require PolymorphicEmbed.OptionsValidator
87

98
alias Ecto.Changeset
@@ -52,19 +51,7 @@ defmodule PolymorphicEmbed do
5251
# # ...
5352
# polymorphic_embeds_one(:fallback_provider, types: @types)
5453
# which means we can't expand aliases
55-
defp expand_alias(types, env) do
56-
Logger.warning("""
57-
Aliases could not be expanded for the given types in #{inspect(env.module)}.
58-
59-
This likely means the types are defined using a module attribute or another reference
60-
that cannot be expanded at compile time. As a result, this may lead to unnecessary
61-
compile-time dependencies, causing longer compilation times and unnecessary
62-
re-compilation of modules (the parent defining the embedded types).
63-
64-
Ensure that the types are specified directly within the macro call to avoid these issues,
65-
or refactor your code to eliminate references that cannot be expanded.
66-
""")
67-
54+
defp expand_alias(types, _env) do
6855
types
6956
end
7057

0 commit comments

Comments
 (0)