Type definition: expected UnionAll, got TypeVar
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In the Julia manual for v0.6 I find the following: abstract type Pointy{T} end struct Point{T} <: Pointy{T} x::T y::T end This works fine, and I thought the following should as well: abstract type Foo{V, F} end struct Bar{V, F} <: Foo{V, F} x::V{F} end The definition of Bar gives, however, the following error ERROR: TypeError: Type{...} expression: expected UnionAll, got TypeVar What is wrong, and how can I achieve what I really want, namely to specify that V<:AbstractVector and F<:AbstractFloat ? 回答1: Try this: julia> abstract type Foo{T}