ash-project / spark

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

fix: fix `Spark.Options.validate_type` for `:fun` #91

Closed vonagam closed 2 months ago

vonagam commented 2 months ago

Two things:

1) There was this for simple :fun error case (the problem is presence of a guard):

defp validate_type(:fun, key, value) when is_function(value) do
  error_tuple(key, value, "expected function in #{render_key(key)}, got: #{inspect(value)}")
end

2) Validate case for {:fun, args} was after {:fun, arity} and neither was checking for a type of the second element.

zachdaniel commented 2 months ago

🚀 Thank you for your contribution! 🚀