`getproperty` with other types than `Symbol`

I noticed that one can overload getproperty with String, not only Symbol (PyCall does this):

julia> struct Foo end

julia> import Base: getproperty

julia> getproperty(::Foo, x::Symbol) = x
getproperty (generic function with 22 methods)

julia> getproperty(::Foo, x::String) = x
getproperty (generic function with 23 methods)

julia> Foo().sdf

julia> Foo()."sdf"

But it doesn’t work with, e.g., integers (this is even a parse error):

julia> getproperty(::Foo, x::Int) = x
getproperty (generic function with 24 methods)

julia> Foo().1
ERROR: syntax: extra token "0.1" after end of expression
 [1] top-level scope at REPL[11]:0

Is there any documentation about what types can (or should) be used?

The getproperty docstring seems to document usage only with symbols. In the integers case, you can quote them, e.g. Foo().:1 .

Ah, that’s a good hint. Apparently, you can use any literals, as long as you quote them:

julia> Foo().:true
ERROR: MethodError: no method matching getproperty(::Foo, ::Bool)
Closest candidates are:
  getproperty(::Foo, ::Foo) at REPL[13]:1
  getproperty(::Foo, ::Int64) at REPL[11]:1
  getproperty(::Foo, ::String) at REPL[8]:1

Although there are some strange corner cases from the parser – the following two count as “just” symbols:

julia> Foo().:nothing

julia> Foo().:notsdf

Note that :true === true, like for integers a quoted Bool is equal to itself. But Foo().true can work directly, as there is no parser ambiguity like with Foo().1. On the other hand, :nothing is a Symbol, i.e. :nothing !== nothing.