-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Elixir and Erlang/OTP versions
Elixir 1.19.2 (both source-compiled and the precompiled version of GH Actions with OTP 27)
Erlang 27.3.4.4 (same)
Operating system
Linux (Fedora 42 and GH Actions' Ubuntu 24)
Current behavior
I have a project that compiles perfectly fine with Elixir 1.19.1, but fails to compile with 1.19.2. As far as I can tell from reading the release notes of 1.19.0-2 there's been no hard deprecation that should cause a problem.
==> ritsplit
Compiling 114 files (.ex)
** (Mix) "def application" has a term which cannot be written to .app files: &RitsplitWeb.Charon.get_base_secret/0
The function capture is defined in config.exs as:
config :ritsplit, :charon,
get_base_secret: &RitsplitWeb.Charon.get_base_secret/0,
...
It is then set as a module attribute in a module Ritsplit.Charon, to be returned from a config/0 function:
defmodule RitsplitWeb.Charon do
# from_enum/1 returns a struct
@config Application.compile_env!(:ritsplit, :charon) |> Charon.Config.from_enum()
def config, do: @config
end
Rewriting to omit the module attribute fixes the issue:
defmodule RitsplitWeb.Charon do
def config, do: Application.get_env(:ritsplit, :charon) |> Charon.Config.from_enum()
end
As far as I know, the previous code is valid.
Expected behavior
I expect it to work :p
Metadata
Metadata
Assignees
Labels
No labels