Skip to content

Dimension checking for vector' * vector is broken #746

Closed
JuliaLang/julia
#36679
@pablosanjose

Description

@pablosanjose

As noted by @marius311 here, the merged PR JuliaLang/julia#35257 seems to cause the following unintended behavior

julia> [1,2]' * [1,2,3.]
5.0
julia> [1,2]' * [1,2,3]
ERROR: DimensionMismatch("first array has length 2 which does not match the length of the second, 3.")

Both should error, but if the eltype is different between the two vectors, it does not. The culprit seems to be https://github.com/JuliaLang/julia/blob/eb4784a8fb7f572b12d9e4c966975bc8d4c8157f/stdlib/LinearAlgebra/src/adjtrans.jl#L247 where zip is used as a fallback

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionRegression in behavior compared to a previous version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions