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
julia> abstract Foo{T}
julia> typealias Bar{T} Foo{T}
Foo{T}
julia> typealias Baz Foo
Foo{T}
julia> type A <:Foo; end
julia> type B <:Bar; end
ERROR: invalid subtyping in definition of B
julia> type C <:Baz; end
Arguably, having a supertype with unfixed parameters is not very useful (or am I missing something?), but if it works for A and C, why shouldn't it for B?
Somewhat more concrete:
julia> type UntypedVector <:AbstractVector; end
ERROR: invalid subtyping in definition of UntypedVector
julia> type UntypedVector <:AbstractArray{TypeVar(:T),1}; end# then try this instead
julia>supertype(UntypedVector) == AbstractVector
true
The root cause seems to be that in the cases that work, the given supertype is a DataType, while in those that don't, it is a TypeConstructor. Might make sense the way it is, but for a casual observer, above examples just look really inconsistent.
The text was updated successfully, but these errors were encountered:
Arguably, having a supertype with unfixed parameters is not very useful (or am I missing something?), but if it works for
A
andC
, why shouldn't it forB
?Somewhat more concrete:
The root cause seems to be that in the cases that work, the given supertype is a
DataType
, while in those that don't, it is aTypeConstructor
. Might make sense the way it is, but for a casual observer, above examples just look really inconsistent.The text was updated successfully, but these errors were encountered: