Skip to content

Commit

Permalink
Merge pull request #52 from sabiwara/fix-elixir1.18
Browse files Browse the repository at this point in the history
Fix compile error in Elixir 1.18 due to unquoting invalid AST
  • Loading branch information
kipcole9 authored Nov 12, 2024
2 parents 5c1cf4c + fa8ad13 commit 2afd995
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/cldr/number/backend/decimal_formatter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ defmodule Cldr.Number.Backend.Decimal.Formatter do
def to_string(number, format, %Options{} = options) when is_binary(format) do
Compiler.maybe_log_compile_warning(
format,
unquote(config),
unquote(config.suppress_warnings),
"ex_cldr_numbers: number format #{inspect(format)} is being compiled. " <>
"For performance reasons please consider adding this format to the " <>
"`precompile_number_formats` list in the backend configuration."
Expand Down
4 changes: 2 additions & 2 deletions lib/cldr/number/format/compiler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ defmodule Cldr.Number.Format.Compiler do
# Log a warning when a number format is being compiled at
# runtime, but only once
@doc false
defmacro maybe_log_compile_warning(format, config, message) do
if Code.ensure_loaded?(:persistent_term) && !config.suppress_warnings do
defmacro maybe_log_compile_warning(format, suppress_warnings, message) do
if Code.ensure_loaded?(:persistent_term) && !suppress_warnings do
quote do
require Cldr.Macros
Cldr.Macros.warn_once(unquote(format), unquote(message))
Expand Down

0 comments on commit 2afd995

Please sign in to comment.