Skip to content

generic_matvecmul complains about deprecated + #94

@acroy

Description

@acroy

We noticed the problem today in SciML/ODE.jl#29. A boiled-down version is

B = Array(typeof([1.,2.]),2);
fill!(B,[1.,2.]);
Base.LinAlg.generic_matvecmul('N', [1. 1.], B)

which gives

WARNING: x::Number + A::Array is deprecated, use x .+ A instead.
 in + at deprecated.jl:26
 in generic_matvecmul at linalg/matmul.jl:310
 in generic_matvecmul at linalg/matmul.jl:274
1-element Array{Any,1}:
 [2.0,4.0]

The problem appears to be that generic_matvecmul (and also generic_matmatmul) uses zero(R) to initialize the variable holding the sum. R is some promoted type, which happens to be Any in the case above and zero(Any)==0. Adding the first product, which is a Vector, triggers the depreciation warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions