I know it is discouraged to use an abstract type for a field in a composite type due to the runtime overhead of looking up the type and method resolution.
Does using an enum type suffer from the same problem? Or is it more performant.
abstract type Side end struct Bid <: Side end struct Ask <: Side end struct Trade ... s::Side end
@enum Side bid ask struct Trade ... s::Side end
Note: in the first code snippet I know I could use a type parameter, but that would lead to type instabilities elsewhere for me