-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Labels
Comments
!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()() |
@juancarlospaco (collaborator) devel 👎 FAILOutput
Stats
IRCompiled filesize0 bytes (0 bytes)
ASTnnkStmtList.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 👎 FAILOutput
Stats
IRCompiled filesize0 bytes (0 bytes)
ASTnnkStmtList.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 👎 FAILOutput
Stats
IRCompiled filesize0 bytes (0 bytes)
ASTnnkStmtList.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 👎 FAILOutput
Stats
IRCompiled filesize0 bytes (0 bytes)
ASTnnkStmtList.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 👎 FAILOutput
Stats
IRCompiled filesize0 bytes (0 bytes)
ASTnnkStmtList.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 👎 FAILOutput
Stats
IRCompiled filesize0 bytes (0 bytes)
ASTnnkStmtList.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 👎 FAILOutput
Stats
IRCompiled filesize0 bytes (0 bytes)
ASTnnkStmtList.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 👎 FAILOutput
Stats
IRCompiled filesize0 bytes (0 bytes)
ASTnnkStmtList.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
🤖 Bug found in |
bung87
added a commit
to bung87/Nim
that referenced
this issue
Aug 25, 2023
…access nested in closure
bung87
added a commit
to bung87/Nim
that referenced
this issue
Aug 25, 2023
…access nested in closure
bung87
added a commit
to bung87/Nim
that referenced
this issue
Aug 25, 2023
…access nested in closure
bung87
added a commit
to bung87/Nim
that referenced
this issue
Aug 25, 2023
…access nested in closure
Araq
pushed a commit
that referenced
this issue
Aug 27, 2023
narimiran
pushed a commit
that referenced
this issue
Sep 11, 2023
narimiran
pushed a commit
that referenced
this issue
Apr 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Nim Version
1.6.14
Current Output
Expected Output
No response
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: