Skip to content

Consistently treat _ as unused in function argument lists #53933

@Keno

Description

@Keno

Since assignment to _ is disallowed, it should be consistently treated as unused in an argument list. We do this for plain definitions, but accidentally try to assign to it when generating wrappers:

julia> f(_) = 1
f (generic function with 1 method)

julia> f(_; a) = 1
ERROR: syntax: all-underscore identifiers are write-only and their values cannot be used in expressions around REPL[1]:1
Stacktrace:
 [1] top-level scope
   @ REPL[1]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler:loweringSyntax lowering (compiler front end, 2nd stage)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions