Skip to content

Commit

Permalink
Narrow structured type argument in diag
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Jul 11, 2023
1 parent 3987311 commit 36931f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FillArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ end
#################

for SMT in (:Diagonal, :Bidiagonal, :Tridiagonal, :SymTridiagonal)
@eval function diag(D::$SMT{<:Number,<:AbstractFillVector}, k::Integer=0)
@eval function diag(D::$SMT{T,<:AbstractFillVector{T}}, k::Integer=0) where {T<:Number}
inds = (1,1) .+ (k >= 0 ? (0,k) : (-k,0))
v = get(D, inds, zero(eltype(D)))
Fill(v, length(diagind(D, k)))
Expand Down

0 comments on commit 36931f1

Please sign in to comment.