Skip to content

Compilation fails on latest Elixir main #53

Closed
@SteffenDE

Description

Hey there,
to catch changes early on I often try to compile things with the latest Elixir version from GitHub. I noticed the following issue.

To reproduce, use latest Elixir from GitHub and try to compile a project with ex_cldr_numbers in it.

I did mix new cldr_bug project, added ex_cldr and ex_cldr_numbers:

defmodule MyApp.Cldr do
  @moduledoc """
  Define a backend module that will host our
  Cldr configuration and public API.

  Most function calls in Cldr will be calls
  to functions on this module.
  """
  use Cldr,
    locales: ["en", "fr", "zh", "th"],
    default_locale: "en",
    providers: [Cldr.Number]

end

and then

~/cldr_bug> mix compile
Compiling 1 file (.ex)
Generating MyApp.Cldr for 5 locales named [:en, :fr, :th, :und, :zh] with a default locale named :en

== Compilation error in file lib/cldr.ex ==
** (ArgumentError) tried to unquote invalid AST: %Cldr.Config{default_locale: :en, locales: [:en, :fr, :th, :und, :zh], add_fallback_locales: false, backend: MyApp.Cldr, gettext: nil, data_dir: "/Users/steffen/cldr_bug/_build/dev/lib/ex_cldr/priv/cldr", providers: [Cldr.Number], precompile_number_formats: [], precompile_transliterations: [], precompile_date_time_formats: [], precompile_interval_formats: [], default_currency_format: nil, otp_app: nil, generate_docs: true, suppress_warnings: false, message_formats: %{}, force_locale_download: false, https_proxy: nil}
Did you forget to escape term using Macro.escape/1?
    (elixir 1.18.0-dev) src/elixir_quote.erl:542: :elixir_quote.argument_error/1
    (ex_cldr_numbers 2.33.3) lib/cldr/number/backend/decimal_formatter.ex:78: Cldr.Number.Backend.Decimal.Formatter.define_number_module/1
    (ex_cldr_numbers 2.33.3) lib/cldr/number/backend/compiler.ex:11: Cldr.Number.Backend.define_number_modules/1
    (ex_cldr 2.40.1) lib/cldr/config/config.ex:2658: anonymous fn/3 in Cldr.Config.define_provider_modules/1
    (elixir 1.18.0-dev) lib/enum.ex:2546: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ex_cldr 2.40.1) lib/cldr/config/config.ex:2656: Cldr.Config.define_provider_modules/1
    (ex_cldr 2.40.1) expanding macro: Cldr.Backend.Compiler.__before_compile__/1
    lib/cldr.ex:1: MyApp.Cldr (module)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions