Eval cannot be used in a generated function

I think Mauro is spot on with the suggestion about traits.

I guess what you’re trying to do here is emulate a missing language feature: the ability to dispatch on which abstract interface a given type satisfies. I don’t have a solution for you, but you might find the following extended discussion interesting:

https://github.com/JuliaLang/julia/issues/6975

1 Like