Skip to content

Error in handling splatted arguments #803

@FHell

Description

@FHell

The following MWE throws an Error for me. This code will usually be a mistake in practice (this is how it showed up for us), but is valid.

function f(p; kwargs...)
    g(p, kwargs...)
end
   
function g(p, a...)
    p
end

f(5.) # works
gradient(f, 5.) # Error

The error is:

ERROR: MethodError: no method matching (::Zygote.var"#pairs_namedtuple#282"{(),NamedTuple{(),Tuple{}}})(::Tuple{})

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