-
-
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
Regression of tuple type inference when @[]
is used.
#23199
Labels
Comments
Very likely proc doNothingWith[T](x: T): T = x
echo doNothingWith((@[], 1)) We can probably add a |
!nim c proc doNothingWith[T](x: T): T = x
let x = doNothingWith((@[], 1)) |
🐧 Linux bisect by @ringabout (member)devel 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("doNothingWith"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("T"),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("T"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("x")
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("doNothingWith"),
nnkTupleConstr.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
)
),
newLit(1)
)
)
)
)
) stable 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("doNothingWith"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("T"),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("T"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("x")
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("doNothingWith"),
nnkTupleConstr.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
)
),
newLit(1)
)
)
)
)
) 2.0.0 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("doNothingWith"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("T"),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("T"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("x")
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("doNothingWith"),
nnkTupleConstr.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
)
),
newLit(1)
)
)
)
)
) 1.6.14 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("doNothingWith"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("T"),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("T"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("x")
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("doNothingWith"),
nnkTupleConstr.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
)
),
newLit(1)
)
)
)
)
) 1.4.8 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("doNothingWith"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("T"),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("T"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("x")
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("doNothingWith"),
nnkPar.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
)
),
newLit(1)
)
)
)
)
) 1.2.18 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("doNothingWith"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("T"),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("T"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("x")
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("doNothingWith"),
nnkPar.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
)
),
newLit(1)
)
)
)
)
) 1.0.10 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkProcDef.newTree(
newIdentNode("doNothingWith"),
newEmptyNode(),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkFormalParams.newTree(
newIdentNode("T"),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("T"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("x")
)
),
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("doNothingWith"),
nnkPar.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
)
),
newLit(1)
)
)
)
)
) Stats
🤖 Bug found in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
This code crashes the compiler with
AssertionDefect
.Of course, everything works when the type is specified explicitly. Works on Nim 1.6.18 as expected.
Nim Version
Nim Compiler Version 2.1.1 [Windows: amd64]
Compiled at 2024-01-11
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 30cb682
active boot switches: -d:release
Nim Compiler Version 2.0.0 [Windows: amd64]
Compiled at 2023-08-01
Copyright (c) 2006-2023 by Andreas Rumpf
active boot switches: -d:release
Current Output
Expected Output
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: