-
-
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
Type section typed AST does not retain postfix node #22933
Comments
Typed AST of type sections do not retain the postfix nodes on the LHS (just becomes nnkSym), not a rendering problem, can confirm with |
Oh okay, thought it might be a bug instead. Closing the issue then. |
Did not mean it was intended behavior, sorry. |
expandMacros
doesn't display all nnkPostfix
nodes properly
Ran into this issue as well. It's annoying because you think you've screwed up the template or macros. |
metagn
added a commit
to metagn/Nim
that referenced
this issue
Dec 18, 2023
This was referenced Dec 18, 2023
Araq
pushed a commit
that referenced
this issue
Dec 18, 2023
Vindaar
pushed a commit
to SciNim/Unchained
that referenced
this issue
Dec 20, 2023
`resolveTypeFromDistinct` calls `getImpl` on the distinct type which yields an `nkTypeDef` node of the original distinct type declaration, and returns the first child of the node, what would normally be the type name. Normally when a type is exported its name in the AST becomes an `nkPostfix` node, however due to a [Nim bug](nim-lang/Nim#22933) this node was not saved in typed AST and the first child was always the type symbol node. If the bug in Nim is fixed, `resolveTypeFromDistinct` has to skip the postfix node here.
metagn
added a commit
to metagn/Nim
that referenced
this issue
Dec 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Using
expandMacros
only displays the*
character on object fields.I also tried adding a
echo repr(n)
to thetoStrLit
function thatexpandMacros
uses but the output was the same.Nim Version
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2023-11-11
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: 52784f3
active boot switches: -d:release
Current Output
Expected Output
Possible Solution
None
Additional Information
Versions 2.0.0 and 1.6.6 gave the same output.
The text was updated successfully, but these errors were encountered: