Open pkalikman opened 8 years ago
Yes, I think this should work but is not implemented at the moment. If a trait is fulfilled for all types of a union then the union should be part of the trait too.
I not gonna have time to work on this for a few weeks. If you want to have a crack at it, probably need to insert a loop at https://github.com/mauro3/Traits.jl/blob/cd4263735c23f864c7a75d740f5c6c29c0d2afff/src/Traits.jl#L143 which loops over all unions and calls istrait recursively.
E.g.:
(edited by @mauro3)
I traced this in the source to
hasparameters
, which seems it rejects this type because the union type is not aDataType
.Is there a principled reason for that? Offhand I don't see why this trait shouldn't be satisfied by the example.
Thanks