Skip to content

_ is treated differently as a parameter name (than as a variable name) #12999

@dawkot

Description

@dawkot

Example

proc foo(_: int, _: float) = discard

Current Output

attempt to redefine: '_'

Expected Output

No error because constructs named _ are normally inaccessible and so can be defined in the same scope, like this:

var
  _: int
  _: float

Additional Information

$ nim -v
Nim Compiler Version 1.0.4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions