Skip to content
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

Fixing more nnkBracketExpr not being checked in hasCustomPragma calling getImpl of nnkBracketExpr #19450

Closed
wants to merge 3 commits into from

Conversation

Clonkk
Copy link
Contributor

@Clonkk Clonkk commented Jan 25, 2022

@Araq This is a follow-up of #19427

It's mostly the same issue : getImpl being called on nnkBracketExpr without checking. I can only fix it where I encounter it (necessary to fix moigagoo/norm#132). but there may other.

I'm wondering if a better fix wouldn't be to check for nnkBracketExpr in a getImpl wrapper (since getImpl is magic) like :

proc getImplChecked(node: NimNode) : NimNode =
  if node.kind() == nnkBracketExpr:
    getImpl(node[0])
  else:
    getImpl(node)

but I do not know the ramification of such a change; or if it's better or worse than adding manual check whenever the issue arise.

…he same issue in getImpl (not taking nnkBracketExpr into account); added tests demonstrating the issue
@Clonkk
Copy link
Contributor Author

Clonkk commented Jan 25, 2022

Continuing in #19451

@Clonkk Clonkk deleted the clonkk_fix_11923 branch January 25, 2022 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generic model do not compile
1 participant