-
-
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
when nimvm doesn't isolate symbols #23687
Comments
!nim c when nimvm:
proc mytest(a: int) =
echo a
else:
template mytest(a: int) =
echo a + 42
proc xxx() =
mytest(100) |
🐧 Linux bisect by @juancarlospaco (collaborator)devel 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkWhenStmt.newTree(
nnkElifBranch.newTree(
newIdentNode("nimvm"),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
newIdentNode("a")
)
)
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkTemplateDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("a"),
newLit(42)
)
)
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("xxx"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("mytest"),
newLit(100)
)
)
)
) stable 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkWhenStmt.newTree(
nnkElifBranch.newTree(
newIdentNode("nimvm"),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
newIdentNode("a")
)
)
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkTemplateDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("a"),
newLit(42)
)
)
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("xxx"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("mytest"),
newLit(100)
)
)
)
) 2.0.4 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkWhenStmt.newTree(
nnkElifBranch.newTree(
newIdentNode("nimvm"),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
newIdentNode("a")
)
)
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkTemplateDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("a"),
newLit(42)
)
)
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("xxx"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("mytest"),
newLit(100)
)
)
)
) 2.0.0 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkWhenStmt.newTree(
nnkElifBranch.newTree(
newIdentNode("nimvm"),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
newIdentNode("a")
)
)
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkTemplateDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("a"),
newLit(42)
)
)
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("xxx"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("mytest"),
newLit(100)
)
)
)
) 1.6.20 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkWhenStmt.newTree(
nnkElifBranch.newTree(
newIdentNode("nimvm"),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
newIdentNode("a")
)
)
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkTemplateDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("a"),
newLit(42)
)
)
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("xxx"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("mytest"),
newLit(100)
)
)
)
) 1.4.8 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkWhenStmt.newTree(
nnkElifBranch.newTree(
newIdentNode("nimvm"),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
newIdentNode("a")
)
)
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkTemplateDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("a"),
newLit(42)
)
)
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("xxx"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("mytest"),
newLit(100)
)
)
)
) 1.2.18 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkWhenStmt.newTree(
nnkElifBranch.newTree(
newIdentNode("nimvm"),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
newIdentNode("a")
)
)
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkTemplateDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("a"),
newLit(42)
)
)
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("xxx"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("mytest"),
newLit(100)
)
)
)
) 1.0.10 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkWhenStmt.newTree(
nnkElifBranch.newTree(
newIdentNode("nimvm"),
nnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
newIdentNode("a")
)
)
)
)
),
nnkElse.newTree(
nnkStmtList.newTree(
nnkTemplateDef.newTree(
newIdentNode("mytest"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("a"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCommand.newTree(
newIdentNode("echo"),
nnkInfix.newTree(
newIdentNode("+"),
newIdentNode("a"),
newLit(42)
)
)
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("xxx"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode()
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("mytest"),
newLit(100)
)
)
)
) Stats
🤖 Bug found in |
metagn
added a commit
to metagn/Nim
that referenced
this issue
Oct 14, 2024
fixes nim-lang#23687, fixes nim-lang#23688, refs nim-lang#13450
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
the vm symbol shouldn't be visible outside of the
when
.Nim Version
1.6, 2.0
Current Output
Expected Output
No response
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: