Closed biona001 closed 2 years ago
This is due to type covariance in Julia, it's not specific to GLM. You need <:Link
:
julia> using GLM
julia> v = [LogLink(), LogLink()]
2-element Vector{LogLink}:
LogLink()
LogLink()
julia> typeof(v) <: Vector{<:Link}
true
You get the same phenomenon with e.g.:
julia> typeof([1, 1]) <: Vector{Number}
false
julia> typeof([1, 1]) <: Vector{<:Number}
true
Given a vector of links, I expected their type of be
<: Vector{Link}
, but this is not generally true:Is this expected?