-
-
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
Bad error message when returning object with missing generic #24372
Labels
Comments
!nim c type
Foo[T] = object
x: string
proc initFoo(): Foo[string] =
Foo(x: "hello")
discard initFoo() |
🐧 Linux bisect by @ringabout (member)devel 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Foo"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("string"),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("initFoo"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("Foo"),
newIdentNode("string")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkObjConstr.newTree(
newIdentNode("Foo"),
nnkExprColonExpr.newTree(
newIdentNode("x"),
newLit("hello")
)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("initFoo")
)
)
) stable 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Foo"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("string"),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("initFoo"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("Foo"),
newIdentNode("string")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkObjConstr.newTree(
newIdentNode("Foo"),
nnkExprColonExpr.newTree(
newIdentNode("x"),
newLit("hello")
)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("initFoo")
)
)
) 2.0.10 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Foo"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("string"),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("initFoo"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("Foo"),
newIdentNode("string")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkObjConstr.newTree(
newIdentNode("Foo"),
nnkExprColonExpr.newTree(
newIdentNode("x"),
newLit("hello")
)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("initFoo")
)
)
) 2.0.0 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Foo"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("string"),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("initFoo"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("Foo"),
newIdentNode("string")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkObjConstr.newTree(
newIdentNode("Foo"),
nnkExprColonExpr.newTree(
newIdentNode("x"),
newLit("hello")
)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("initFoo")
)
)
) 1.6.20 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Foo"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("string"),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("initFoo"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("Foo"),
newIdentNode("string")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkObjConstr.newTree(
newIdentNode("Foo"),
nnkExprColonExpr.newTree(
newIdentNode("x"),
newLit("hello")
)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("initFoo")
)
)
) 1.4.8 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Foo"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("string"),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("initFoo"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("Foo"),
newIdentNode("string")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkObjConstr.newTree(
newIdentNode("Foo"),
nnkExprColonExpr.newTree(
newIdentNode("x"),
newLit("hello")
)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("initFoo")
)
)
) 1.2.18 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Foo"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("string"),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("initFoo"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("Foo"),
newIdentNode("string")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkObjConstr.newTree(
newIdentNode("Foo"),
nnkExprColonExpr.newTree(
newIdentNode("x"),
newLit("hello")
)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("initFoo")
)
)
) 1.0.10 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkTypeSection.newTree(
nnkTypeDef.newTree(
newIdentNode("Foo"),
nnkGenericParams.newTree(
nnkIdentDefs.newTree(
newIdentNode("T"),
newEmptyNode(),
newEmptyNode()
)
),
nnkObjectTy.newTree(
newEmptyNode(),
newEmptyNode(),
nnkRecList.newTree(
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("string"),
newEmptyNode()
)
)
)
)
),
nnkProcDef.newTree(
newIdentNode("initFoo"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("Foo"),
newIdentNode("string")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkObjConstr.newTree(
newIdentNode("Foo"),
nnkExprColonExpr.newTree(
newIdentNode("x"),
newLit("hello")
)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("initFoo")
)
)
) Stats
🤖 Bug found in |
Correct error message in devel now? Weird |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
This code passes
nim check
but then fails to compile. Previously it returned an error when checking.Nim Version
Nim Compiler Version 2.2.1 [Linux: amd64]
Compiled at 2024-10-27
Copyright (c) 2006-2024 by Andreas Rumpf
git hash: 24aa92c
active boot switches: -d:release
Current Output
Expected Output
Either the previous message
Or have the generic inferred
Known Workarounds
No response
Additional Information
Fails with
--mm:refc
also, but in ccgexprs.nimThe text was updated successfully, but these errors were encountered: