Skip to content

Weird behavior when unpacking nested tuple in nim 2.2.5 #129

@m33mt33n

Description

@m33mt33n
let data = @[
  (1, (2, 3)),
  (4, (5, 6)),
  (7, (8, 9))
]
for (outer, (inner1, inner2)) in data:
  echo "Outer: ", outer, ", Inner1: ", inner1, ", Inner2: ", inner2
  • Above snippet failed to compile with below error:
    file.nim(7, 13) Error: identifier expected, but found '(inner1, inner2, )'

  • Nim Compiler Version 2.2.5 [Linux: arm]

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions