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
Describe the bug
I have an entity defined with a schema option (i.e news) that is a keyword list with its key types defined by keys. One of the fields (publication_date) may be a function that will return a string for the field. But when I compile this code, I get an error
Error: cannot inject attribute @urls into function/macro because cannot escape #Function<>
It does compile when I remove {:fun, [:map], :string} from the list of type options for publication_date. It does escape the function correctly for the :path option
So spark can't choose to escape/not escape types (that happens after spark comes into play), but what we should do given how these specifications are generally used is not have any three-tuple types.
The function type needs some overhauling anyway, as we need to be able to name each argument type. For now, the type just won't be usable in that context.
So spark can't choose to escape/not escape types (that happens after spark comes into play), but what we should do given how these specifications are generally used is not have any three-tuple types.
Thanks for the explanation. So this means its impossible to allow a function to customize the :publication_date?
You would just need to either use a custom type or a less specific function type, i.e {:fun, 1} means "any one argument function", and that can be successfully unquoted.
Describe the bug
I have an entity defined with a schema option (i.e news) that is a keyword list with its key types defined by keys. One of the fields (publication_date) may be a function that will return a string for the field. But when I compile this code, I get an error
It does compile when I remove
{:fun, [:map], :string}
from the list of type options for publication_date. It does escape the function correctly for the :path optionTo Reproduce
Use the above urls entity as an example
Expected behavior
I expected spark to parse the types of the publication_date correctly
Runtime
The text was updated successfully, but these errors were encountered: