-
-
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
Compiler crash with generics static int, Atomics, range #22922
Labels
Comments
hugosenari
changed the title
Compiler crash due to generics static int, Atomics, range
Compiler crash with generics static int, Atomics, range
Nov 8, 2023
!nim c import std/atomics
type
R [L: static int] = range[0..L]
Q [L: static int] = object
v: Atomic[R[L]]
proc f[L: static int](q: Q[L]): void =
discard
var q: Q[4]
q.f |
🐧 Linux bisect by @ringabout (member)devel 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("atomics")
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("R"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("range"),
nnkInfix.newTree(
newIdentNode(".."),
newLit(0),
newIdentNode("L")
)
)
),
nnkTypeDef.newTree(
newIdentNode("Q"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("Atomic"),
nnkBracketExpr.newTree(
newIdentNode("R"),
newIdentNode("L")
)
),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("f"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("void"),
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newIdentNode("L")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newLit(4)
),
newEmptyNode()
)
),
nnkDotExpr.newTree(
newIdentNode("q"),
newIdentNode("f")
)
) stable 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("atomics")
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("R"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("range"),
nnkInfix.newTree(
newIdentNode(".."),
newLit(0),
newIdentNode("L")
)
)
),
nnkTypeDef.newTree(
newIdentNode("Q"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("Atomic"),
nnkBracketExpr.newTree(
newIdentNode("R"),
newIdentNode("L")
)
),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("f"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("void"),
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newIdentNode("L")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newLit(4)
),
newEmptyNode()
)
),
nnkDotExpr.newTree(
newIdentNode("q"),
newIdentNode("f")
)
) 2.0.0 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("atomics")
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("R"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("range"),
nnkInfix.newTree(
newIdentNode(".."),
newLit(0),
newIdentNode("L")
)
)
),
nnkTypeDef.newTree(
newIdentNode("Q"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("Atomic"),
nnkBracketExpr.newTree(
newIdentNode("R"),
newIdentNode("L")
)
),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("f"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("void"),
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newIdentNode("L")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newLit(4)
),
newEmptyNode()
)
),
nnkDotExpr.newTree(
newIdentNode("q"),
newIdentNode("f")
)
) 1.6.14 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("atomics")
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("R"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("range"),
nnkInfix.newTree(
newIdentNode(".."),
newLit(0),
newIdentNode("L")
)
)
),
nnkTypeDef.newTree(
newIdentNode("Q"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("Atomic"),
nnkBracketExpr.newTree(
newIdentNode("R"),
newIdentNode("L")
)
),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("f"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("void"),
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newIdentNode("L")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newLit(4)
),
newEmptyNode()
)
),
nnkDotExpr.newTree(
newIdentNode("q"),
newIdentNode("f")
)
) 1.4.8 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("atomics")
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("R"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("range"),
nnkInfix.newTree(
newIdentNode(".."),
newLit(0),
newIdentNode("L")
)
)
),
nnkTypeDef.newTree(
newIdentNode("Q"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("Atomic"),
nnkBracketExpr.newTree(
newIdentNode("R"),
newIdentNode("L")
)
),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("f"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("void"),
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newIdentNode("L")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newLit(4)
),
newEmptyNode()
)
),
nnkDotExpr.newTree(
newIdentNode("q"),
newIdentNode("f")
)
) 1.2.18 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("atomics")
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("R"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("range"),
nnkInfix.newTree(
newIdentNode(".."),
newLit(0),
newIdentNode("L")
)
)
),
nnkTypeDef.newTree(
newIdentNode("Q"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("Atomic"),
nnkBracketExpr.newTree(
newIdentNode("R"),
newIdentNode("L")
)
),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("f"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("void"),
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newIdentNode("L")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newLit(4)
),
newEmptyNode()
)
),
nnkDotExpr.newTree(
newIdentNode("q"),
newIdentNode("f")
)
) 1.0.10 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("atomics")
)
),
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("R"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkBracketExpr.newTree(
newIdentNode("range"),
nnkInfix.newTree(
newIdentNode(".."),
newLit(0),
newIdentNode("L")
)
)
),
nnkTypeDef.newTree(
newIdentNode("Q"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("Atomic"),
nnkBracketExpr.newTree(
newIdentNode("R"),
newIdentNode("L")
)
),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("f"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("L"),
nnkCommand.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("void"),
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newIdentNode("L")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("q"),
nnkBracketExpr.newTree(
newIdentNode("Q"),
newLit(4)
),
newEmptyNode()
)
),
nnkDotExpr.newTree(
newIdentNode("q"),
newIdentNode("f")
)
) Stats
🤖 Bug found in |
The |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Compiler crash with generics static int, Atomics, range
/home/hugosenari/Code/NimCloned/lib/system/fatal.nim(53) sysFatal
Error: unhandled exception: field 'intVal' is not accessible for type 'TNode' using 'kind = nkStaticExpr' [FieldDefect]
Nim Version
Nim Compiler Version 2.0.0 [Linux: amd64]
Compiled at 2023-11-07
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: a488067
Current Output
Expected Output
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: