While composing a minimal working example for #11821, I came across the following:
struct foo{T} <: T where {T<:Real}
bar::T
end
seems to not throw a convert
MethodError for declarations such as
julia> foo(3.0 + 1im)
foo{Complex{Float64}}(3.0 + 1.0im)
This is naturally absent when there’s no subtyping:
struct foo{T<:Real}
bar::T
end
will prompt a convert
MethodError for foo(3.0 + 1im)
.