Following the question asked here Propagate Type Parameters in Methods for Julia - Stack Overflow.
If you define a constant like
const RT{R<:Real} = Type{R}
then defining a method using this constant without a parameter
rt(r::RT) = r
keeps the type restriction, which can be seen by inspecting the defined method:
julia> methods(rt)
# 1 method for generic function "rt":
[1] rt(::Type{R} where R<:Real) in Main at REPL[16]:1
However, if you can overwrite this restriction when defining a method like this:
julia> methods(rt2)
# 1 method for generic function "rt2":
[1] rt2(::Type{R}) where R<:AbstractString in Main at REPL[29]:1
julia> rt3(::RT{R} where {R <: AbstractString}) = R
rt3 (generic function with 1 method)
julia> methods(rt3)
# 1 method for generic function "rt3":
[1] rt3(::Type{R} where R<:AbstractString) in Main at REPL[31]:1
Is this behavior indented?