We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import macros type Past[Z] = object OpenObject = object macro rewriter(prc: untyped): untyped = prc.body.add(nnkCall.newTree( prc.params[0] )) prc macro macroAsync(name, restype: untyped): untyped = quote do: proc `name`(): Past[seq[`restype`]] {.rewriter.} = discard macroAsync(testMacro, OpenObject)
Error: cannot instantiate Past [type declared in /tmp/test.nim(4, 3)] got: <T> but expected: <Z>
Compiles correctly
On every nim version I tested. Caused problems in chronos, worked around with: status-im/nim-chronos#261, which allows to cleanup the opensyms:
proc cleanupOpenSymChoice(node: NimNode): NimNode {.compileTime.} = if node.kind in nnkCallKinds and node[0].kind == nnkOpenSymChoice and node[0].eqIdent("[]"): result = newNimNode(nnkBracketExpr) for child in node[1..^1]: result.add(cleanupOpenSymChoice(child)) else: result = node.copyNimNode() for child in node: result.add(cleanupOpenSymChoice(child))
With
prc.body.add(nnkCall.newTree( cleanupOpenSymChoice(prc.params[0])
The first code now compiles correctly.
The text was updated successfully, but these errors were encountered:
got: <S> but expected: <T>
Works in devel probably because of #23983
Sorry, something went wrong.
generic issues test cases
1f69047
closes nim-lang#1969, closes nim-lang#7737, closes nim-lang#11838, closes nim-lang#12283, closes nim-lang#14053, closes nim-lang#16118, closes nim-lang#19670, closes nim-lang#22645
fc853cb
Successfully merging a pull request may close this issue.
Example
Current Output
Expected Output
Compiles correctly
Additional Information
On every nim version I tested. Caused problems in chronos, worked around with: status-im/nim-chronos#261, which allows to cleanup the opensyms:
With
The first code now compiles correctly.
The text was updated successfully, but these errors were encountered: