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

"environment misses" for type reference in iterator access nested in closure #22548

Closed
arnetheduck opened this issue Aug 24, 2023 · 2 comments · Fixed by #22559
Closed

"environment misses" for type reference in iterator access nested in closure #22548

arnetheduck opened this issue Aug 24, 2023 · 2 comments · Fixed by #22559

Comments

@arnetheduck
Copy link
Contributor

arnetheduck commented Aug 24, 2023

Description

type Xxx[T] = object

iterator x(v: string): char =
  var v: Xxx[int]

  var y: v.T

  echo y

proc bbb(vv: string): proc () =
  proc xxx() =
    for c in x(vv):
      echo c

  return xxx

bbb("test")()

Nim Version

1.6.14

Current Output

testit.nim(9, 10) Error: internal error: environment misses: v

Expected Output

No response

Possible Solution

No response

Additional Information

No response

@juancarlospaco
Copy link
Collaborator

!nim c

type O[T] = object

iterator x(v: string): char =
  var v: O[int]
  var y: v.T
  echo y

proc f(): proc =
  proc z() =
    for c in x("abc"): echo c
  return z

f()()

@github-actions
Copy link
Contributor

@juancarlospaco (collaborator)

devel 👎 FAIL

Output

Error: Command failed: nim c --run  -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(4, 10) Error: internal error: environment misses: v

Stats

  • Started 2023-08-24T12:02:53
  • Finished 2023-08-24T12:02:53
  • Duration

IR

Compiled filesize 0 bytes (0 bytes)

AST

nnkStmtList.newTree(
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      newIdentNode("O"),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        newEmptyNode()
      )
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("x"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("char"),
      nnkIdentDefs.newTree(
        newIdentNode("v"),
        newIdentNode("string"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("v"),
          nnkBracketExpr.newTree(
            newIdentNode("O"),
            newIdentNode("int")
          ),
          newEmptyNode()
        )
      ),
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("y"),
          nnkDotExpr.newTree(
            newIdentNode("v"),
            newIdentNode("T")
          ),
          newEmptyNode()
        )
      ),
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("y")
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("f"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      nnkProcTy.newTree(
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("z"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("c"),
            nnkCall.newTree(
              newIdentNode("x"),
              newLit("abc")
            ),
            nnkStmtList.newTree(
              nnkCommand.newTree(
                newIdentNode("echo"),
                newIdentNode("c")
              )
            )
          )
        )
      ),
      nnkReturnStmt.newTree(
        newIdentNode("z")
      )
    )
  ),
  nnkCall.newTree(
    nnkCall.newTree(
      newIdentNode("f")
    )
  )
)
stable 👎 FAIL

Output

Error: Command failed: nim c --run  -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(4, 10) Error: internal error: environment misses: v

Stats

  • Started 2023-08-24T12:02:54
  • Finished 2023-08-24T12:02:54
  • Duration

IR

Compiled filesize 0 bytes (0 bytes)

AST

nnkStmtList.newTree(
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      newIdentNode("O"),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        newEmptyNode()
      )
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("x"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("char"),
      nnkIdentDefs.newTree(
        newIdentNode("v"),
        newIdentNode("string"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("v"),
          nnkBracketExpr.newTree(
            newIdentNode("O"),
            newIdentNode("int")
          ),
          newEmptyNode()
        )
      ),
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("y"),
          nnkDotExpr.newTree(
            newIdentNode("v"),
            newIdentNode("T")
          ),
          newEmptyNode()
        )
      ),
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("y")
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("f"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      nnkProcTy.newTree(
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("z"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("c"),
            nnkCall.newTree(
              newIdentNode("x"),
              newLit("abc")
            ),
            nnkStmtList.newTree(
              nnkCommand.newTree(
                newIdentNode("echo"),
                newIdentNode("c")
              )
            )
          )
        )
      ),
      nnkReturnStmt.newTree(
        newIdentNode("z")
      )
    )
  ),
  nnkCall.newTree(
    nnkCall.newTree(
      newIdentNode("f")
    )
  )
)
2.0.0 👎 FAIL

Output

Error: Command failed: nim c --run  -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(4, 10) Error: internal error: environment misses: v

Stats

  • Started 2023-08-24T12:02:54
  • Finished 2023-08-24T12:02:55
  • Duration

IR

Compiled filesize 0 bytes (0 bytes)

AST

nnkStmtList.newTree(
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      newIdentNode("O"),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        newEmptyNode()
      )
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("x"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("char"),
      nnkIdentDefs.newTree(
        newIdentNode("v"),
        newIdentNode("string"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("v"),
          nnkBracketExpr.newTree(
            newIdentNode("O"),
            newIdentNode("int")
          ),
          newEmptyNode()
        )
      ),
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("y"),
          nnkDotExpr.newTree(
            newIdentNode("v"),
            newIdentNode("T")
          ),
          newEmptyNode()
        )
      ),
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("y")
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("f"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      nnkProcTy.newTree(
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("z"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("c"),
            nnkCall.newTree(
              newIdentNode("x"),
              newLit("abc")
            ),
            nnkStmtList.newTree(
              nnkCommand.newTree(
                newIdentNode("echo"),
                newIdentNode("c")
              )
            )
          )
        )
      ),
      nnkReturnStmt.newTree(
        newIdentNode("z")
      )
    )
  ),
  nnkCall.newTree(
    nnkCall.newTree(
      newIdentNode("f")
    )
  )
)
1.6.0 👎 FAIL

Output

Error: Command failed: nim c --run  -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(4, 10) Error: internal error: environment misses: v

Stats

  • Started 2023-08-24T12:02:57
  • Finished 2023-08-24T12:02:58
  • Duration

IR

Compiled filesize 0 bytes (0 bytes)

AST

nnkStmtList.newTree(
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      newIdentNode("O"),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        newEmptyNode()
      )
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("x"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("char"),
      nnkIdentDefs.newTree(
        newIdentNode("v"),
        newIdentNode("string"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("v"),
          nnkBracketExpr.newTree(
            newIdentNode("O"),
            newIdentNode("int")
          ),
          newEmptyNode()
        )
      ),
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("y"),
          nnkDotExpr.newTree(
            newIdentNode("v"),
            newIdentNode("T")
          ),
          newEmptyNode()
        )
      ),
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("y")
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("f"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      nnkProcTy.newTree(
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("z"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("c"),
            nnkCall.newTree(
              newIdentNode("x"),
              newLit("abc")
            ),
            nnkStmtList.newTree(
              nnkCommand.newTree(
                newIdentNode("echo"),
                newIdentNode("c")
              )
            )
          )
        )
      ),
      nnkReturnStmt.newTree(
        newIdentNode("z")
      )
    )
  ),
  nnkCall.newTree(
    nnkCall.newTree(
      newIdentNode("f")
    )
  )
)
1.4.0 👎 FAIL

Output

Error: Command failed: nim c --run  -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(4, 10) Error: internal error: environment misses: v

Stats

  • Started 2023-08-24T12:03:00
  • Finished 2023-08-24T12:03:01
  • Duration

IR

Compiled filesize 0 bytes (0 bytes)

AST

nnkStmtList.newTree(
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      newIdentNode("O"),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        newEmptyNode()
      )
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("x"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("char"),
      nnkIdentDefs.newTree(
        newIdentNode("v"),
        newIdentNode("string"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("v"),
          nnkBracketExpr.newTree(
            newIdentNode("O"),
            newIdentNode("int")
          ),
          newEmptyNode()
        )
      ),
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("y"),
          nnkDotExpr.newTree(
            newIdentNode("v"),
            newIdentNode("T")
          ),
          newEmptyNode()
        )
      ),
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("y")
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("f"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      nnkProcTy.newTree(
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("z"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("c"),
            nnkCall.newTree(
              newIdentNode("x"),
              newLit("abc")
            ),
            nnkStmtList.newTree(
              nnkCommand.newTree(
                newIdentNode("echo"),
                newIdentNode("c")
              )
            )
          )
        )
      ),
      nnkReturnStmt.newTree(
        newIdentNode("z")
      )
    )
  ),
  nnkCall.newTree(
    nnkCall.newTree(
      newIdentNode("f")
    )
  )
)
1.2.0 👎 FAIL

Output

Error: Command failed: nim c --run  -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(4, 10) Error: internal error: environment misses: v

Stats

  • Started 2023-08-24T12:03:16
  • Finished 2023-08-24T12:03:17
  • Duration

IR

Compiled filesize 0 bytes (0 bytes)

AST

nnkStmtList.newTree(
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      newIdentNode("O"),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        newEmptyNode()
      )
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("x"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("char"),
      nnkIdentDefs.newTree(
        newIdentNode("v"),
        newIdentNode("string"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("v"),
          nnkBracketExpr.newTree(
            newIdentNode("O"),
            newIdentNode("int")
          ),
          newEmptyNode()
        )
      ),
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("y"),
          nnkDotExpr.newTree(
            newIdentNode("v"),
            newIdentNode("T")
          ),
          newEmptyNode()
        )
      ),
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("y")
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("f"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      nnkProcTy.newTree(
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("z"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("c"),
            nnkCall.newTree(
              newIdentNode("x"),
              newLit("abc")
            ),
            nnkStmtList.newTree(
              nnkCommand.newTree(
                newIdentNode("echo"),
                newIdentNode("c")
              )
            )
          )
        )
      ),
      nnkReturnStmt.newTree(
        newIdentNode("z")
      )
    )
  ),
  nnkCall.newTree(
    nnkCall.newTree(
      newIdentNode("f")
    )
  )
)
1.0.0 👎 FAIL

Output

Error: Command failed: nim c --run  -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(4, 10) Error: internal error: environment misses: v

Stats

  • Started 2023-08-24T12:03:30
  • Finished 2023-08-24T12:03:30
  • Duration

IR

Compiled filesize 0 bytes (0 bytes)

AST

nnkStmtList.newTree(
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      newIdentNode("O"),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        newEmptyNode()
      )
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("x"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("char"),
      nnkIdentDefs.newTree(
        newIdentNode("v"),
        newIdentNode("string"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("v"),
          nnkBracketExpr.newTree(
            newIdentNode("O"),
            newIdentNode("int")
          ),
          newEmptyNode()
        )
      ),
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("y"),
          nnkDotExpr.newTree(
            newIdentNode("v"),
            newIdentNode("T")
          ),
          newEmptyNode()
        )
      ),
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("y")
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("f"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      nnkProcTy.newTree(
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("z"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("c"),
            nnkCall.newTree(
              newIdentNode("x"),
              newLit("abc")
            ),
            nnkStmtList.newTree(
              nnkCommand.newTree(
                newIdentNode("echo"),
                newIdentNode("c")
              )
            )
          )
        )
      ),
      nnkReturnStmt.newTree(
        newIdentNode("z")
      )
    )
  ),
  nnkCall.newTree(
    nnkCall.newTree(
      newIdentNode("f")
    )
  )
)
0.20.2 👎 FAIL

Output

Error: Command failed: nim c --run  -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(4, 10) Error: internal error: environment misses: v

Stats

  • Started 2023-08-24T12:03:40
  • Finished 2023-08-24T12:03:40
  • Duration

IR

Compiled filesize 0 bytes (0 bytes)

AST

nnkStmtList.newTree(
  nnkTypeSection.newTree(
    nnkTypeDef.newTree(
      newIdentNode("O"),
      nnkGenericParams.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("T"),
          newEmptyNode(),
          newEmptyNode()
        )
      ),
      nnkObjectTy.newTree(
        newEmptyNode(),
        newEmptyNode(),
        newEmptyNode()
      )
    )
  ),
  nnkIteratorDef.newTree(
    newIdentNode("x"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      newIdentNode("char"),
      nnkIdentDefs.newTree(
        newIdentNode("v"),
        newIdentNode("string"),
        newEmptyNode()
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("v"),
          nnkBracketExpr.newTree(
            newIdentNode("O"),
            newIdentNode("int")
          ),
          newEmptyNode()
        )
      ),
      nnkVarSection.newTree(
        nnkIdentDefs.newTree(
          newIdentNode("y"),
          nnkDotExpr.newTree(
            newIdentNode("v"),
            newIdentNode("T")
          ),
          newEmptyNode()
        )
      ),
      nnkCommand.newTree(
        newIdentNode("echo"),
        newIdentNode("y")
      )
    )
  ),
  nnkProcDef.newTree(
    newIdentNode("f"),
    newEmptyNode(),
    newEmptyNode(),
    nnkFormalParams.newTree(
      nnkProcTy.newTree(
      )
    ),
    newEmptyNode(),
    newEmptyNode(),
    nnkStmtList.newTree(
      nnkProcDef.newTree(
        newIdentNode("z"),
        newEmptyNode(),
        newEmptyNode(),
        nnkFormalParams.newTree(
          newEmptyNode()
        ),
        newEmptyNode(),
        newEmptyNode(),
        nnkStmtList.newTree(
          nnkForStmt.newTree(
            newIdentNode("c"),
            nnkCall.newTree(
              newIdentNode("x"),
              newLit("abc")
            ),
            nnkStmtList.newTree(
              nnkCommand.newTree(
                newIdentNode("echo"),
                newIdentNode("c")
              )
            )
          )
        )
      ),
      nnkReturnStmt.newTree(
        newIdentNode("z")
      )
    )
  ),
  nnkCall.newTree(
    nnkCall.newTree(
      newIdentNode("f")
    )
  )
)
Stats
  • GCC 11.4.0
  • LibC 2.35
  • Valgrind 3.18.1
  • NodeJS 17.1
  • Linux 5.15.0
  • Created 2023-08-24T12:01:59Z
  • Comments 1
  • Commands nim c --run -d:nimDebugDlOpen -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --verbosity:0 --hints:off --warnings: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 51 minutes bisecting 8 commits at 0 commits per second.

bung87 added a commit to bung87/Nim that referenced this issue Aug 25, 2023
bung87 added a commit to bung87/Nim that referenced this issue Aug 25, 2023
bung87 added a commit to bung87/Nim that referenced this issue Aug 25, 2023
bung87 added a commit to bung87/Nim that referenced this issue Aug 25, 2023
Araq pushed a commit that referenced this issue Aug 27, 2023
#22559)

* fix #22548;environment misses for type reference in iterator access nested in closure

* fix #21737

* Update lambdalifting.nim

* remove containsCallKinds

* simplify
narimiran pushed a commit that referenced this issue Sep 11, 2023
#22559)

* fix #22548;environment misses for type reference in iterator access nested in closure

* fix #21737

* Update lambdalifting.nim

* remove containsCallKinds

* simplify

(cherry picked from commit 0b78b7f)
narimiran pushed a commit that referenced this issue Apr 17, 2024
#22559)

* fix #22548;environment misses for type reference in iterator access nested in closure

* fix #21737

* Update lambdalifting.nim

* remove containsCallKinds

* simplify

(cherry picked from commit 0b78b7f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants