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

fix semFinishOperands for bracket expressions [backport:2.0] #23571

Merged
merged 1 commit into from
May 8, 2024

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented May 4, 2024

fixes #23568, fixes #23310

In #23091 semFinishOperands was changed to not be called for mArrGet and mArrPut, presumably in preparation for #23188 (not sure why it was needed in #23091, maybe they got mixed together), since the compiler handles these later and needs the first argument to not be completely "typed" since brackets can serve as explicit generic instantiations in which case the first argument would have to be an unresolved generic proc (not accepted by finishOperand).

In this PR we just make it so mArrGet and mArrPut specifically skip calling finishOperand on the first argument. This way the generic arguments in the explicit instantiation get typed, but not the unresolved generic proc.

@metagn metagn changed the title fix semFinishOperand for bracket expressions [backport:2.0] fix semFinishOperands for bracket expressions [backport:2.0] May 4, 2024
@Araq Araq merged commit 09bd9d0 into nim-lang:devel May 8, 2024
19 checks passed
Copy link
Contributor

github-actions bot commented May 8, 2024

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 09bd9d0

Hint: mm: orc; opt: speed; options: -d:release
178554 lines; 8.532s; 752.82MiB peakmem

narimiran pushed a commit that referenced this pull request May 8, 2024
fixes #23568, fixes #23310

In #23091 `semFinishOperands` was changed to not be called for `mArrGet`
and `mArrPut`, presumably in preparation for #23188 (not sure why it was
needed in #23091, maybe they got mixed together), since the compiler
handles these later and needs the first argument to not be completely
"typed" since brackets can serve as explicit generic instantiations in
which case the first argument would have to be an unresolved generic
proc (not accepted by `finishOperand`).

In this PR we just make it so `mArrGet` and `mArrPut` specifically skip
calling `finishOperand` on the first argument. This way the generic
arguments in the explicit instantiation get typed, but not the
unresolved generic proc.

(cherry picked from commit 09bd9d0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants