ash-project / spark

Tooling for building DSLs in Elixir
MIT License
105 stars 23 forks source link

Some compiler deprecation warnings inside spark_function_behaviour #6

Closed jimsynz closed 1 year ago

jimsynz commented 1 year ago

Describe the bug Compiler deprecation warnings if Application.fetch_env is used in a spark_function_behavior option. More generally, the anonymous function body is being unquoted into the module body during compile, causing this issue Elixir to emit deprecation warnings for code that is actually only called at runtime.

To Reproduce Put Application.fetch_env inside any options which are of spark_function_behaviour type.

Expected behavior There should be no compiler warnings, and yet all is still well.

Runtime

Additional context Add any other context about the problem here.