-
-
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
Internal error when using function with static parameter as default argument #21725
Labels
Comments
Likely should error due to not having a specified generic parameter(remember static parameters are really generics). The following should also error of course. proc doThing[T] = echo T
proc doOtherThing(fn = doThing) = fn()
doOtherThing() |
!nim c func a(v: static[int]): int = v
func b(f=a): int = f(1)
discard b() |
@juancarlospaco (contributor) devel :-1: FAILOutput
Stats
IRASTnnkStmtList.newTree(
nnkFuncDef.newTree(
newIdentNode("a"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("v")
)
),
nnkFuncDef.newTree(
newIdentNode("b"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("f"),
newEmptyNode(),
newIdentNode("a")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("f"),
newLit(1)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("b")
)
)
) stable :-1: FAILOutput
Stats
IRASTnnkStmtList.newTree(
nnkFuncDef.newTree(
newIdentNode("a"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("v")
)
),
nnkFuncDef.newTree(
newIdentNode("b"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("f"),
newEmptyNode(),
newIdentNode("a")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("f"),
newLit(1)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("b")
)
)
) 1.6.0 :-1: FAILOutput
Stats
IRASTnnkStmtList.newTree(
nnkFuncDef.newTree(
newIdentNode("a"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("v")
)
),
nnkFuncDef.newTree(
newIdentNode("b"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("f"),
newEmptyNode(),
newIdentNode("a")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("f"),
newLit(1)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("b")
)
)
) 1.4.0 :-1: FAILOutput
Stats
IRASTnnkStmtList.newTree(
nnkFuncDef.newTree(
newIdentNode("a"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("v")
)
),
nnkFuncDef.newTree(
newIdentNode("b"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("f"),
newEmptyNode(),
newIdentNode("a")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("f"),
newLit(1)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("b")
)
)
) 1.2.0 :-1: FAILOutput
Stats
IRASTnnkStmtList.newTree(
nnkFuncDef.newTree(
newIdentNode("a"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("v")
)
),
nnkFuncDef.newTree(
newIdentNode("b"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("f"),
newEmptyNode(),
newIdentNode("a")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("f"),
newLit(1)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("b")
)
)
) 1.0.0 :-1: FAILOutput
Stats
IRASTnnkStmtList.newTree(
nnkFuncDef.newTree(
newIdentNode("a"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("v"),
nnkBracketExpr.newTree(
newIdentNode("static"),
newIdentNode("int")
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
newIdentNode("v")
)
),
nnkFuncDef.newTree(
newIdentNode("b"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newIdentNode("int"),
nnkIdentDefs.newTree(
newIdentNode("f"),
newEmptyNode(),
newIdentNode("a")
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkCall.newTree(
newIdentNode("f"),
newLit(1)
)
)
),
nnkDiscardStmt.newTree(
nnkCall.newTree(
newIdentNode("b")
)
)
) 38 minutes bisecting 6 commits at 0 commits per second.
|
Probably related #16906
Should error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The code below results in an internal error, the static parameter messes with instantiation
Passing
test1(test2)
is also kinda strange, but at least no internal errorNim Version
git hash: 897dff6
Current Output
Expected Output
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: