You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When applying a restriction to a abstract type parameter a subtype it is possible to define a subtype that is not actually a subtype:
julia>abstract type AbstractFoo{T<:Integer} end
julia>struct Foo1{T} <:AbstractFoo{T}end
julia>struct Foo2{T <:Integer} <:AbstractFoo{T}end
julia> Foo1 <:AbstractFoofalse
julia> Foo2 <:AbstractFootrue
I believe this to be a bug as by definition Foo1 is a subtype of AbstractFoo. Similarly definitions where the subtype attempts to expand the scope of the parameter should probably be disallowed:
struct Foo3{T <:Real} <:AbstractFoo{T}end
The text was updated successfully, but these errors were encountered:
You aren't making a broken subtype, just defining a primary alias that isn't a subtype of the other primary alias:
julia> abstract type AbstractFoo{T<:Integer} end
julia> struct Foo2{T <: Integer} <: AbstractFoo{T} end
julia> (Foo2{T} where T) <: AbstractFoo
false
julia> (Foo2{T} where T) <: (AbstractFoo{T} where T)
true
When applying a restriction to a abstract type parameter a subtype it is possible to define a subtype that is not actually a subtype:
I believe this to be a bug as by definition
Foo1
is a subtype ofAbstractFoo
. Similarly definitions where the subtype attempts to expand the scope of the parameter should probably be disallowed:The text was updated successfully, but these errors were encountered: