I am wondering if supertypes that are computed are explicitly supported. Eg consider
using Enzyme
struct MockEnzymeMode <: supertype(typeof(Enzyme.Reverse)) end
where I construct an Enzyme.jl mode for testing an API (it should error as unimplemented), because the type params of Enzyme.Mode
are not part of its API so I have to resort to these kind of tricks.
Empirically, these things work, eg
struct Foo <: supertype(typeof([1.0, 2.0, 3.0])) end
will be <:Vector{Float64}
. But I am wondering if they are explicitly supported. I could not find a mention in the manual. I am implicitly assuming that the value used is that obtained the time the expression was lowered, eg
gimmetype() = Vector{Float64}
struct Bar <: supertype(gimmetype()) end
gimmetype() = Vector{Int} # overwrite
will not change the type definition.