Skip to content

? behaves strangely as an identifier #6286

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

Metadata

Assignees

No one assigned

    Labels

    parserLanguage parsing and surface syntax

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions