Skip to content

Slurped kwargs with a type are an error in Julia 1.7 #43625

@cstjean

Description

@cstjean

On Julia 1.7.1, slurped kwargs can no longer have a type declaration:

julia> f(args::Any...) = 10
f (generic function with 2 methods)

julia> f(;kwargs::Any...) = 10
ERROR: syntax: "kwargs::Any" is not a valid function argument name around REPL[24]:1
Stacktrace:
 [1] top-level scope
   @ REPL[24]:1

This is a headache for us at FluxML/MacroTools.jl#177. Was that intentional? I wonder if this wasn't an unintended side-effect of #40977

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