Validates the type of each declared field at compile time.
The Spark schema gives the type of a field the Spark type :any, because no Spark type
accepts a {:list, type} tuple or a struct module. Without this check,
field :id, :strng compiles with no error, and the field then matches no value at
runtime.
Summary
Functions
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.
The primitive types that a manifest can give a field.
Whether atom names a module rather than a plain atom.
Whether type is a valid field type.
Functions
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.
@spec primitives() :: [atom()]
The primitive types that a manifest can give a field.
Whether atom names a module rather than a plain atom.
Whether type is a valid field type.
The compiler may not have compiled a struct module yet when this check runs. So the
check finds a struct module by its Elixir. prefix, and does not load the module.