Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: identifier expected, but found '(0, 0)[0]' with let _ = in for _ in r.fields #24339

Open
tersec opened this issue Oct 22, 2024 · 2 comments · May be fixed by #24341
Open

Error: identifier expected, but found '(0, 0)[0]' with let _ = in for _ in r.fields #24339

tersec opened this issue Oct 22, 2024 · 2 comments · May be fixed by #24341
Assignees

Comments

@tersec
Copy link
Contributor

tersec commented Oct 22, 2024

Description

const r = (0, 0)
for _ in r.fields:
  let _ = 0

Nim Version

Nim Compiler Version 2.0.10 [Linux: amd64]
Compiled at 2024-10-21
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: e941ee15be775fe3c46db1bed9b4f41c7dfb1334
active boot switches: -d:release
Nim Compiler Version 2.0.11 [Linux: amd64]
Compiled at 2024-10-21
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: e334aad20220ddb5fad63002102d5557464f48c1
active boot switches: -d:release
Nim Compiler Version 2.2.0 [Linux: amd64]
Compiled at 2024-10-21
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 78983f1876726a49c69d65629ab433ea1310ece1
active boot switches: -d:release
Nim Compiler Version 2.2.1 [Linux: amd64]
Compiled at 2024-10-21
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 67442471ae4504bc074c8bb02308613fadc199f8
active boot switches: -d:release

Current Output

/tmp/g.nim(3, 7) Error: identifier expected, but found '(0, 0)[0]'

Expected Output

Compiles

Known Workarounds

No response

Additional Information

No response

@ringabout
Copy link
Member

!nim c

const r = (0, 0)
for _ in r.fields:
  let _ = 0

Copy link
Contributor

🐧 Linux bisect by @ringabout (member)
devel 👎 FAIL

Output


IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-10-22T01:52:14
  • Finished 2024-10-22T01:52:14
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("r"),
      newEmptyNode(),
      nnkTupleConstr.newTree(
        newLit(0),
        newLit(0)
      )
    )
  ),
  nnkForStmt.newTree(
    newIdentNode("_"),
    nnkDotExpr.newTree(
      newIdentNode("r"),
      newIdentNode("fields")
    ),
    nnkStmtList.newTree(
      nnkLetSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("_"),
          newEmptyNode(),
          newLit(0)
        )
      )
    )
  )
)
stable 👎 FAIL

Output


IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-10-22T01:52:18
  • Finished 2024-10-22T01:52:18
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("r"),
      newEmptyNode(),
      nnkTupleConstr.newTree(
        newLit(0),
        newLit(0)
      )
    )
  ),
  nnkForStmt.newTree(
    newIdentNode("_"),
    nnkDotExpr.newTree(
      newIdentNode("r"),
      newIdentNode("fields")
    ),
    nnkStmtList.newTree(
      nnkLetSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("_"),
          newEmptyNode(),
          newLit(0)
        )
      )
    )
  )
)
2.0.10 👎 FAIL

Output


IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-10-22T01:52:22
  • Finished 2024-10-22T01:52:22
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("r"),
      newEmptyNode(),
      nnkTupleConstr.newTree(
        newLit(0),
        newLit(0)
      )
    )
  ),
  nnkForStmt.newTree(
    newIdentNode("_"),
    nnkDotExpr.newTree(
      newIdentNode("r"),
      newIdentNode("fields")
    ),
    nnkStmtList.newTree(
      nnkLetSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("_"),
          newEmptyNode(),
          newLit(0)
        )
      )
    )
  )
)
2.0.0 👎 FAIL

Output


IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-10-22T01:52:26
  • Finished 2024-10-22T01:52:26
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("r"),
      newEmptyNode(),
      nnkTupleConstr.newTree(
        newLit(0),
        newLit(0)
      )
    )
  ),
  nnkForStmt.newTree(
    newIdentNode("_"),
    nnkDotExpr.newTree(
      newIdentNode("r"),
      newIdentNode("fields")
    ),
    nnkStmtList.newTree(
      nnkLetSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("_"),
          newEmptyNode(),
          newLit(0)
        )
      )
    )
  )
)
1.6.20 👎 FAIL

Output


IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-10-22T01:52:30
  • Finished 2024-10-22T01:52:30
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("r"),
      newEmptyNode(),
      nnkTupleConstr.newTree(
        newLit(0),
        newLit(0)
      )
    )
  ),
  nnkForStmt.newTree(
    newIdentNode("_"),
    nnkDotExpr.newTree(
      newIdentNode("r"),
      newIdentNode("fields")
    ),
    nnkStmtList.newTree(
      nnkLetSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("_"),
          newEmptyNode(),
          newLit(0)
        )
      )
    )
  )
)
1.4.8 👎 FAIL

Output


IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-10-22T01:52:33
  • Finished 2024-10-22T01:52:33
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("r"),
      newEmptyNode(),
      nnkPar.newTree(
        newLit(0),
        newLit(0)
      )
    )
  ),
  nnkForStmt.newTree(
    newIdentNode("_"),
    nnkDotExpr.newTree(
      newIdentNode("r"),
      newIdentNode("fields")
    ),
    nnkStmtList.newTree(
      nnkLetSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("_"),
          newEmptyNode(),
          newLit(0)
        )
      )
    )
  )
)
1.2.18 👎 FAIL

Output


IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-10-22T01:52:36
  • Finished 2024-10-22T01:52:36
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("r"),
      newEmptyNode(),
      nnkPar.newTree(
        newLit(0),
        newLit(0)
      )
    )
  ),
  nnkForStmt.newTree(
    newIdentNode("_"),
    nnkDotExpr.newTree(
      newIdentNode("r"),
      newIdentNode("fields")
    ),
    nnkStmtList.newTree(
      nnkLetSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("_"),
          newEmptyNode(),
          newLit(0)
        )
      )
    )
  )
)
1.0.10 👎 FAIL

Output


IR

Compiled filesize 0 (0 bytes)

Stats

  • Started 2024-10-22T01:52:39
  • Finished 2024-10-22T01:52:39
  • Duration

AST

nnkStmtList.newTree(
  nnkConstSection.newTree(
    nnkConstDef.newTree(
      newIdentNode("r"),
      newEmptyNode(),
      nnkPar.newTree(
        newLit(0),
        newLit(0)
      )
    )
  ),
  nnkForStmt.newTree(
    newIdentNode("_"),
    nnkDotExpr.newTree(
      newIdentNode("r"),
      newIdentNode("fields")
    ),
    nnkStmtList.newTree(
      nnkLetSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("_"),
          newEmptyNode(),
          newLit(0)
        )
      )
    )
  )
)
Stats
  • GCC 11.4.0
  • Clang 14.0.0
  • NodeJS 20.4
  • Created 2024-10-22T01:51:45Z
  • Comments 1
  • Commands nim c --run -d:nimDebug -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim

🤖 Bug found in 27 mins bisecting 8 commits at 0 commits per second

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants