Skip to content

Missing ! in __safe_axpy, causing potential exceptions #14

@Azercoco

Description

@Azercoco

Describe the bug 🐞

In the code:

@inline @generated function __safe_axpy!(α, x, y)
    hasmethod(axpy!, Tuple{typeof(α), typeof(x), typeof(y)}) || return :(axpy!(α, x, y))
    return :(@. y += α * x)
end

, a not ! is missing before hasmethod. This causes the code to never actually go to :(axpy!(α, x, y)) (or only when hasmethod is false, potentially causing an exception) .

Expected behavior

Either change hasmethod to !hasmethodor || to && to get the desired behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions