Closed
Description
I have a composite type which has a single Dict property that I thought would be interesting to access with an overloaded ? operator
type J9Type
propDict::Dict
end
function ?(obj::J9Type,field::Union(Symbol,String))
return get(obj.propDict,field,Nothing())
end
A = J9Type([:p1=>1,:p2=>2,:p3=>7])
I found that I could only use my overloaded ?
operator if I mention it before hand, even with a comment. Otherwise it says that ?
is not a generic function.
#?
?(A,:p1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment