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

Follow up #54772 - don't accidentally put Module into method name slot #54856

Merged
merged 1 commit into from
Jun 23, 2024

Conversation

Keno
Copy link
Member

@Keno Keno commented Jun 20, 2024

The :outerref removal (#54772) ended up accidentally putting a Module argument into 3-argument :method due to a bad refactor. We didn't catch this in the tests, because the name slot of 3-argument :method is
unused (except for external method tables), but ordinarily contains
the same data as 1-argument :method.
That said, some packages in the Revise universe look at this (arguably incorrectly, since they should be looking at the signature instead), so it should be correct until we fix Revise, at which point we may just want to always pass false here.

@Keno Keno requested a review from JeffBezanson June 20, 2024 05:46

# Test that lowering doesn't accidentally put a `Module` in the Method name slot
let src = @Meta.lower let capture=1
global foo_lower_block
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, the reason this must be in lowering (and wrong to inspect the signature unless lowering instructs that it must) is that this line could be:

Suggested change
global foo_lower_block
global const foo_lower_block = Base.redirect_stdin

And looking at the signature would wrongly name this Method as Base.RedirectStdStream(0), when syntactically it has the different intended name foo_lower_block

The `:outerref` removal (#54772) ended up accidentally putting a `Module`
argument into 3-argument `:method` due to a bad refactor. We didn't catch
this in the tests, because the name slot of 3-argument `:method` is
 unused (except for external method tables), but ordinarily contains
the same data as 1-argument `:method`.
That said, some packages in the Revise universe look at this
(arguably incorrectly, since they should be looking at the
signature instead), so it should be correct until we fix Revise,
at which point we may just want to always pass `false` here.
@Keno Keno added the status:merge me PR is reviewed. Merge when all tests are passing label Jun 23, 2024
@Keno Keno merged commit 696d9c3 into master Jun 23, 2024
8 checks passed
@Keno Keno deleted the kf/54772followup branch June 23, 2024 18:24
@DilumAluthge DilumAluthge removed the status:merge me PR is reviewed. Merge when all tests are passing label Jul 6, 2024
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.

None yet

3 participants