Open
Description
Consider the following example:
julia> specializing_typeof(::T) where {T} = T;
julia> specializing_typeof(::Type{T}) where {T} = Type{T};
julia> specializing_typeof((Type{T} where {T}).body)
ERROR: UndefVarError: `T` not defined in static parameter matching
Suggestion: run Test.detect_unbound_args to detect method arguments that do not fully constrain a type parameter.
Stacktrace:
I don't understand why it matches the second signature and hits an error, when the first signature is actually a valid match for it. For example, if I didn't have the second method, I get
julia> specializing_typeof(::T) where {T} = T;
julia> specializing_typeof((Type{T} where {T}).body)
DataType
which seems right to me.
Is this behavior expected?
(On 1.11.5; I'm assuming it is also seen in other versions)