Skip to content

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

Merged
Keno merged 1 commit intomasterfrom
kf/54772followup
Jun 23, 2024
Merged

Follow up #54772 - don't accidentally put Module into method name slot#54856
Keno merged 1 commit intomasterfrom
kf/54772followup

Conversation

@Keno
Copy link
Copy Markdown
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
Copy Markdown
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 force-pushed the kf/54772followup branch from b022c19 to 5262090 Compare June 23, 2024 14:09
@Keno Keno added the 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
@Keno Keno deleted the kf/54772followup branch June 23, 2024 18:24
@DilumAluthge DilumAluthge removed the 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.

3 participants