-
-
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
nim-1.6.14 regression: overload resolution between function that returns iterator and other type always expects iterator #23200
Labels
Comments
!nim c import sugar
import sequtils
proc dosomething(iter: int -> (iterator: int)) =
discard
proc dosomething(iter: int -> seq[int]) =
discard
proc makeSeq(x: int): seq[int] =
@[x]
# Works fine with 1.6.12 and 1.6.14
dosomething(makeSeq)
# Works with 1.6.12, fails with 1.6.14
dosomething((y) => makeSeq(y)) |
🐧 Linux bisect by @ringabout (member)devel 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
newIdentNode("sugar")
),
nnkImportStmt.newTree(
newIdentNode("sequtils")
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkPar.newTree(
nnkIteratorTy.newTree(
nnkFormalParams.newTree(
newIdentNode("int")
),
newEmptyNode()
)
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("makeSeq"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
newIdentNode("x")
)
)
)
),
nnkCall.newTree(
newIdentNode("dosomething"),
newIdentNode("makeSeq")
),
nnkCall.newTree(
newIdentNode("dosomething"),
nnkInfix.newTree(
newIdentNode("=>"),
nnkPar.newTree(
newIdentNode("y")
),
nnkCall.newTree(
newIdentNode("makeSeq"),
newIdentNode("y")
)
)
)
) stable 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
newIdentNode("sugar")
),
nnkImportStmt.newTree(
newIdentNode("sequtils")
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkPar.newTree(
nnkIteratorTy.newTree(
nnkFormalParams.newTree(
newIdentNode("int")
),
newEmptyNode()
)
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("makeSeq"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
newIdentNode("x")
)
)
)
),
nnkCall.newTree(
newIdentNode("dosomething"),
newIdentNode("makeSeq")
),
nnkCall.newTree(
newIdentNode("dosomething"),
nnkInfix.newTree(
newIdentNode("=>"),
nnkPar.newTree(
newIdentNode("y")
),
nnkCall.newTree(
newIdentNode("makeSeq"),
newIdentNode("y")
)
)
)
) 2.0.0 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
newIdentNode("sugar")
),
nnkImportStmt.newTree(
newIdentNode("sequtils")
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkPar.newTree(
nnkIteratorTy.newTree(
nnkFormalParams.newTree(
newIdentNode("int")
),
newEmptyNode()
)
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("makeSeq"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
newIdentNode("x")
)
)
)
),
nnkCall.newTree(
newIdentNode("dosomething"),
newIdentNode("makeSeq")
),
nnkCall.newTree(
newIdentNode("dosomething"),
nnkInfix.newTree(
newIdentNode("=>"),
nnkPar.newTree(
newIdentNode("y")
),
nnkCall.newTree(
newIdentNode("makeSeq"),
newIdentNode("y")
)
)
)
) 1.6.14 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
newIdentNode("sugar")
),
nnkImportStmt.newTree(
newIdentNode("sequtils")
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkPar.newTree(
nnkIteratorTy.newTree(
nnkFormalParams.newTree(
newIdentNode("int")
),
newEmptyNode()
)
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("makeSeq"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
newIdentNode("x")
)
)
)
),
nnkCall.newTree(
newIdentNode("dosomething"),
newIdentNode("makeSeq")
),
nnkCall.newTree(
newIdentNode("dosomething"),
nnkInfix.newTree(
newIdentNode("=>"),
nnkPar.newTree(
newIdentNode("y")
),
nnkCall.newTree(
newIdentNode("makeSeq"),
newIdentNode("y")
)
)
)
) 1.4.8 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
newIdentNode("sugar")
),
nnkImportStmt.newTree(
newIdentNode("sequtils")
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkPar.newTree(
nnkIteratorTy.newTree(
nnkFormalParams.newTree(
newIdentNode("int")
),
newEmptyNode()
)
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("makeSeq"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
newIdentNode("x")
)
)
)
),
nnkCall.newTree(
newIdentNode("dosomething"),
newIdentNode("makeSeq")
),
nnkCall.newTree(
newIdentNode("dosomething"),
nnkInfix.newTree(
newIdentNode("=>"),
nnkPar.newTree(
newIdentNode("y")
),
nnkCall.newTree(
newIdentNode("makeSeq"),
newIdentNode("y")
)
)
)
) 1.2.18 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
newIdentNode("sugar")
),
nnkImportStmt.newTree(
newIdentNode("sequtils")
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkPar.newTree(
nnkIteratorTy.newTree(
nnkFormalParams.newTree(
newIdentNode("int")
),
newEmptyNode()
)
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("makeSeq"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
newIdentNode("x")
)
)
)
),
nnkCall.newTree(
newIdentNode("dosomething"),
newIdentNode("makeSeq")
),
nnkCall.newTree(
newIdentNode("dosomething"),
nnkInfix.newTree(
newIdentNode("=>"),
nnkPar.newTree(
newIdentNode("y")
),
nnkCall.newTree(
newIdentNode("makeSeq"),
newIdentNode("y")
)
)
)
) 1.0.10 👎 FAILOutput
IRCompiled filesize0 bytes (0 bytes)
Stats
ASTnnkStmtList.newTree(
nnkImportStmt.newTree(
newIdentNode("sugar")
),
nnkImportStmt.newTree(
newIdentNode("sequtils")
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkPar.newTree(
nnkIteratorTy.newTree(
nnkFormalParams.newTree(
newIdentNode("int")
),
newEmptyNode()
)
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("dosomething"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
newEmptyNode(),
nnkIdentDefs.newTree(
newIdentNode("iter"),
nnkInfix.newTree(
newIdentNode("->"),
newIdentNode("int"),
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
)
),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
),
nnkProcDef.newTree(
newIdentNode("makeSeq"),
newEmptyNode(),
newEmptyNode(),
nnkFormalParams.newTree(
nnkBracketExpr.newTree(
newIdentNode("seq"),
newIdentNode("int")
),
nnkIdentDefs.newTree(
newIdentNode("x"),
newIdentNode("int"),
newEmptyNode()
)
),
newEmptyNode(),
newEmptyNode(),
nnkStmtList.newTree(
nnkPrefix.newTree(
newIdentNode("@"),
nnkBracket.newTree(
newIdentNode("x")
)
)
)
),
nnkCall.newTree(
newIdentNode("dosomething"),
newIdentNode("makeSeq")
),
nnkCall.newTree(
newIdentNode("dosomething"),
nnkInfix.newTree(
newIdentNode("=>"),
nnkPar.newTree(
newIdentNode("y")
),
nnkCall.newTree(
newIdentNode("makeSeq"),
newIdentNode("y")
)
)
)
) Stats
🤖 Bug found in |
Neat tool! Maybe a good feature request is to be able to set boundaries in case there's some set of code that's also broken on old versions like it appears this is. I manually bisected and found 4ea0ce9 to be the culprit. |
dsemi
added a commit
to dsemi/advent_nim
that referenced
this issue
Jan 14, 2024
metagn
added a commit
to metagn/Nim
that referenced
this issue
Jan 14, 2024
narimiran
pushed a commit
that referenced
this issue
Apr 19, 2024
fixes #23200, fixes #18866 #21065 made it so `auto` proc return types remained as `tyAnything` and not turned to `tyUntyped`. This had the side effect that anything previously bound to `tyAnything` in the proc type match was then bound to the proc return type, which is wrong since we don't know the proc return type even if we know the expected parameter types (`tyUntyped` also [does not care about its previous bindings in `typeRel`](https://github.com/nim-lang/Nim/blob/ab4278d2179639f19967431a7aa1be858046f7a7/compiler/sigmatch.nim#L1059-L1061) maybe for this reason). Now we mark `tyAnything` return types for routines as `tfRetType` [as done for other meta return types](https://github.com/nim-lang/Nim/blob/18b5fb256d4647efa6a64df451d37129d36e96f3/compiler/semtypes.nim#L1451), and ignore bindings to `tyAnything` + `tfRetType` types in `semtypinst`. On top of this, we reset the type relation in `paramTypesMatch` only after creating the instantiation (instead of trusting `isInferred`/`isInferredConvertible` before creating the instantiation), using the same mechanism that `isBothMetaConvertible` uses. This fixes the issues as well as making the disabled t15386_2 test introduced in #21065 work. As seen in the changes for the other tests, the error messages give an obscure `proc (a: GenericParam): auto` now, but it does give the correct error that the overload doesn't match instead of matching the overload pre-emptively and expecting a specific return type. tsugar had to be changed due to #16906, which is the problem where `void` is not inferred in the case where `result` was never touched. (cherry picked from commit f46f26e)
narimiran
pushed a commit
that referenced
this issue
Apr 27, 2024
fixes #23200, fixes #18866 not turned to `tyUntyped`. This had the side effect that anything previously bound to `tyAnything` in the proc type match was then bound to the proc return type, which is wrong since we don't know the proc return type even if we know the expected parameter types (`tyUntyped` also [does not care about its previous bindings in `typeRel`](https://github.com/nim-lang/Nim/blob/ab4278d2179639f19967431a7aa1be858046f7a7/compiler/sigmatch.nim#L1059-L1061) maybe for this reason). Now we mark `tyAnything` return types for routines as `tfRetType` [as done for other meta return types](https://github.com/nim-lang/Nim/blob/18b5fb256d4647efa6a64df451d37129d36e96f3/compiler/semtypes.nim#L1451), and ignore bindings to `tyAnything` + `tfRetType` types in `semtypinst`. On top of this, we reset the type relation in `paramTypesMatch` only after creating the instantiation (instead of trusting `isInferred`/`isInferredConvertible` before creating the instantiation), using the same mechanism that `isBothMetaConvertible` uses. This fixes the issues as well as making the disabled t15386_2 test introduced in #21065 work. As seen in the changes for the other tests, the error messages give an obscure `proc (a: GenericParam): auto` now, but it does give the correct error that the overload doesn't match instead of matching the overload pre-emptively and expecting a specific return type. tsugar had to be changed due to #16906, which is the problem where `void` is not inferred in the case where `result` was never touched. (cherry picked from commit f46f26e)
narimiran
pushed a commit
that referenced
this issue
Apr 27, 2024
fixes #23200, fixes #18866 not turned to `tyUntyped`. This had the side effect that anything previously bound to `tyAnything` in the proc type match was then bound to the proc return type, which is wrong since we don't know the proc return type even if we know the expected parameter types (`tyUntyped` also [does not care about its previous bindings in `typeRel`](https://github.com/nim-lang/Nim/blob/ab4278d2179639f19967431a7aa1be858046f7a7/compiler/sigmatch.nim#L1059-L1061) maybe for this reason). Now we mark `tyAnything` return types for routines as `tfRetType` [as done for other meta return types](https://github.com/nim-lang/Nim/blob/18b5fb256d4647efa6a64df451d37129d36e96f3/compiler/semtypes.nim#L1451), and ignore bindings to `tyAnything` + `tfRetType` types in `semtypinst`. On top of this, we reset the type relation in `paramTypesMatch` only after creating the instantiation (instead of trusting `isInferred`/`isInferredConvertible` before creating the instantiation), using the same mechanism that `isBothMetaConvertible` uses. This fixes the issues as well as making the disabled t15386_2 test introduced in #21065 work. As seen in the changes for the other tests, the error messages give an obscure `proc (a: GenericParam): auto` now, but it does give the correct error that the overload doesn't match instead of matching the overload pre-emptively and expecting a specific return type. tsugar had to be changed due to #16906, which is the problem where `void` is not inferred in the case where `result` was never touched. (cherry picked from commit f46f26e)
narimiran
pushed a commit
that referenced
this issue
Apr 27, 2024
fixes #23200, fixes #18866 not turned to `tyUntyped`. This had the side effect that anything previously bound to `tyAnything` in the proc type match was then bound to the proc return type, which is wrong since we don't know the proc return type even if we know the expected parameter types (`tyUntyped` also [does not care about its previous bindings in `typeRel`](https://github.com/nim-lang/Nim/blob/ab4278d2179639f19967431a7aa1be858046f7a7/compiler/sigmatch.nim#L1059-L1061) maybe for this reason). Now we mark `tyAnything` return types for routines as `tfRetType` [as done for other meta return types](https://github.com/nim-lang/Nim/blob/18b5fb256d4647efa6a64df451d37129d36e96f3/compiler/semtypes.nim#L1451), and ignore bindings to `tyAnything` + `tfRetType` types in `semtypinst`. On top of this, we reset the type relation in `paramTypesMatch` only after creating the instantiation (instead of trusting `isInferred`/`isInferredConvertible` before creating the instantiation), using the same mechanism that `isBothMetaConvertible` uses. This fixes the issues as well as making the disabled t15386_2 test introduced in #21065 work. As seen in the changes for the other tests, the error messages give an obscure `proc (a: GenericParam): auto` now, but it does give the correct error that the overload doesn't match instead of matching the overload pre-emptively and expecting a specific return type. tsugar had to be changed due to #16906, which is the problem where `void` is not inferred in the case where `result` was never touched. (cherry picked from commit f46f26e)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
This code compiles and runs fine under 1.6.12, but fails under 1.6.14 and newer:
Nim Version
Nim Compiler Version 1.6.14 [MacOSX: arm64]
Compiled at 2024-01-11
Copyright (c) 2006-2023 by Andreas Rumpf
(also reproduced on x86_64 linux)
Current Output
Expected Output
Possible Solution
No response
Additional Information
Removing the iterator overload causes the code to compile in both versions.
The text was updated successfully, but these errors were encountered: