You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I want to say I'm excited to be using your library to quickly generate a config module for a Spotify client I'm writing at the moment. It vastly simplifies some of my logic and makes it easy for the user (and me!) to fetch (and potentially update!) their configuration for my library at runtime.
However, I'm using Elixir 1.10.0 and Erlang 22, and have ran into the following issue with defining my own custom type.
The type is for validating that a user has passed only Spotify scopes (to avoid any oopsies) as either a list or space-separated string of scopes. It's rather simple:
Unfortunately it seems that at compile time, the private Skogsra.Spec.get_spec_type/1 function is receiving {:__aliases__, _, [:DeSpotify, :ScopeList]}, but does not have a function definition for matching on an AST. Here is the compilation error in full:
== Compilation error in file lib/config.ex ==
** (FunctionClauseError) no function clause matching in Skogsra.Spec.get_spec_type/1
The following arguments were given to Skogsra.Spec.get_spec_type/1:
# 1
{:__aliases__, [line: 53], [:ScopeList]}
Attempted function clauses (showing 9 out of 9):
defp get_spec_type(:binary)
defp get_spec_type(:integer)
defp get_spec_type(:float)
defp get_spec_type(:boolean)
defp get_spec_type(:atom)
defp get_spec_type(:module)
defp get_spec_type(:unsafe_module)
defp get_spec_type(module) when is_atom(module)
defp get_spec_type(options) when is_list(options)
lib/skogsra/spec.ex:60: Skogsra.Spec.get_spec_type/1
lib/skogsra/spec.ex:11: Skogsra.Spec.gen_full_spec/2
expanding macro: Skogsra.app_env/4
lib/config.ex:51: DeSpotify.Config (module)
Is there something that I am missing or getting wrong? My knee-jerk intuition is that a subtle change in how Elixir produces :__aliases__ ASTs has happened across major versions (note again that I'm using Elixir 1.10.0), but I have not looked deeper. Let me know if I can provide any more information and I am looking forward to hearing from you.
Christian
The text was updated successfully, but these errors were encountered:
Hi, I want to say I'm excited to be using your library to quickly generate a config module for a Spotify client I'm writing at the moment. It vastly simplifies some of my logic and makes it easy for the user (and me!) to fetch (and potentially update!) their configuration for my library at runtime.
However, I'm using Elixir 1.10.0 and Erlang 22, and have ran into the following issue with defining my own custom type.
The type is for validating that a user has passed only Spotify scopes (to avoid any oopsies) as either a list or space-separated string of scopes. It's rather simple:
And then used it in a module which has
use Skogsra
at the top, like so:Unfortunately it seems that at compile time, the private
Skogsra.Spec.get_spec_type/1
function is receiving{:__aliases__, _, [:DeSpotify, :ScopeList]}
, but does not have a function definition for matching on an AST. Here is the compilation error in full:Is there something that I am missing or getting wrong? My knee-jerk intuition is that a subtle change in how Elixir produces
:__aliases__
ASTs has happened across major versions (note again that I'm using Elixir 1.10.0), but I have not looked deeper. Let me know if I can provide any more information and I am looking forward to hearing from you.Christian
The text was updated successfully, but these errors were encountered: