This repository was archived by the owner on Feb 7, 2019. It is now read-only.

Description
E.g.:
using Traits
@traitdef SomeTrait{X} begin
some_function(X) -> Int64
end
immutable TypeOne
x::Float64
end
immutable TypeTwo
x::Int64
end
typealias FloatOrInt Union{TypeOne,TypeTwo}
some_function(x::FloatOrInt) = 1
(edited by @mauro3)
istrait(SomeTrait{FloatOrInt})
ERROR: Traits.TraitException("Trait SomeTrait{Union{TypeOne,TypeTwo}} has no type parameters.")
I traced this in the source to hasparameters, which seems it rejects this type because the union type is not a DataType.
Is there a principled reason for that? Offhand I don't see why this trait shouldn't be satisfied by the example.
Thanks