Skip to content

Conversation

@vtjnash
Copy link
Member

@vtjnash vtjnash commented Feb 21, 2024

We already allowed method shadowing for an inexact signature and implicit method deletion by exact signatures, so it was fairly arbitrary to implement it as a deletion for a replacement by an exact signature rather than use the morespecific definition for this.

This change should be useful to Mocking libraries, such as Pluto, which previously had a buggier version of this which tried to re-activate or re-define the old methods.

There is a bit of code cleanup in here, either of unused features, or of aspects that were broken, or of world_valid computations that were not actually impacting the final result (e.g. when there is a more specific result matches, it does not need to limit the result valid world range because of a less specific result that does not get returned).

@vtjnash vtjnash added the types and dispatch Types, subtyping and method dispatch label Feb 21, 2024
@vtjnash vtjnash changed the title gf: allow method shadowing with exact signatures gf: allow method shadowing with exact signatures without deletion Feb 21, 2024
We already allowed method shadowing for an inexact signature and
implicit method deletion by exact signatures, so it was fairly arbitrary
to implement it as a deletion for a replacement by an exact signature
rather than use the morespecific definition for this.

This change should be useful to Mocking libraries, such as Pluto, which
previously had a buggier version of this which tried to re-activate or
re-define the old methods.

There is a bit of code cleanup in here, either of unused features, or of
aspects that were broken, or of world_valid computations that were not
actually impacting the final result (e.g. when there is a more specific
result matches, it does not need to limit the result valid world range
because of a less specific result that does not get returned).
@vtjnash vtjnash force-pushed the jn/replaceable-methods branch from 7b21ea3 to d610327 Compare February 23, 2024 20:10
@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Feb 23, 2024
@vtjnash vtjnash merged commit a2be715 into master Feb 26, 2024
@vtjnash vtjnash deleted the jn/replaceable-methods branch February 26, 2024 21:08
@inkydragon inkydragon removed the merge me PR is reviewed. Merge when all tests are passing label Feb 26, 2024
tecosaur pushed a commit to tecosaur/julia that referenced this pull request Mar 4, 2024
…liaLang#53415)

We already allowed method shadowing for an inexact signature and
implicit method deletion by exact signatures, so it was fairly arbitrary
to implement it as a deletion for a replacement by an exact signature
rather than use the morespecific definition for this.

This change should be useful to Mocking libraries, such as Pluto, which
previously had a buggier version of this which tried to re-activate or
re-define the old methods.

There is a bit of code cleanup in here, either of unused features, or of
aspects that were broken, or of world_valid computations that were not
actually impacting the final result (e.g. when there is a more specific
result matches, it does not need to limit the result valid world range
because of a less specific result that does not get returned).
@fonsp
Copy link
Member

fonsp commented Mar 5, 2024

Yayy thanks! I'm really happy that you helped make our method functionality more stable, and also making it easier for other projects in the future! 🌟

@vtjnash
Copy link
Member Author

vtjnash commented Mar 5, 2024

Thanks for inspiring it, basically by having Pluto show that it should be valid and that it is useful

mkitti pushed a commit to mkitti/julia that referenced this pull request Mar 7, 2024
…liaLang#53415)

We already allowed method shadowing for an inexact signature and
implicit method deletion by exact signatures, so it was fairly arbitrary
to implement it as a deletion for a replacement by an exact signature
rather than use the morespecific definition for this.

This change should be useful to Mocking libraries, such as Pluto, which
previously had a buggier version of this which tried to re-activate or
re-define the old methods.

There is a bit of code cleanup in here, either of unused features, or of
aspects that were broken, or of world_valid computations that were not
actually impacting the final result (e.g. when there is a more specific
result matches, it does not need to limit the result valid world range
because of a less specific result that does not get returned).
vtjnash added a commit that referenced this pull request Apr 30, 2025
…ch_status enum

The original purpose of this was to manage quickly detecting if a method
was replaced, but that stopped being correct after #53415. It is also a
fairly heavy-weight description of a single bit of information, and
apparently (despite not having "min" or "max" anywhere in the name), its
existence misleads people into thinking that primary/deleted are somehow
corresponding to min/max. That is always false: this bit only exists for
invalidations, and primary_world is primarily valid to use for
supporting generated functions (or cases like `show` where correctness
isn't especially important, though we may use it at times as a short-cut
to computing the result of a dispatch result).

This implements METHOD_ISMINMAX_INVOKE_LATEST fully, and provides just a
stub for adding METHOD_ISMINMAX_CALL_LATEST later.

Fix #58215
vtjnash added a commit that referenced this pull request May 6, 2025
…ch_status enum

The original purpose of this was to manage quickly detecting if a method
was replaced, but that stopped being correct after #53415. It is also a
fairly heavy-weight description of a single bit of information, and
apparently (despite not having "min" or "max" anywhere in the name), its
existence misleads people into thinking that primary/deleted are somehow
corresponding to min/max. That is always false: this bit only exists for
invalidations, and primary_world is primarily valid to use for
supporting generated functions (or cases like `show` where correctness
isn't especially important, though we may use it at times as a short-cut
to computing the result of a dispatch result).

This implements METHOD_ISMINMAX_INVOKE_LATEST fully, and provides just a
stub for adding METHOD_ISMINMAX_CALL_LATEST later.

Fix #58215
vtjnash added a commit that referenced this pull request May 6, 2025
…ch_status enum

The original purpose of this was to manage quickly detecting if a method
was replaced, but that stopped being correct after #53415. It is also a
fairly heavy-weight description of a single bit of information, and
apparently (despite not having "min" or "max" anywhere in the name), its
existence misleads people into thinking that primary/deleted are somehow
corresponding to min/max. That is always false: this bit only exists for
invalidations, and primary_world is primarily valid to use for
supporting generated functions (or cases like `show` where correctness
isn't especially important, though we may use it at times as a short-cut
to computing the result of a dispatch result).

This implements METHOD_ISMINMAX_INVOKE_LATEST fully, and provides just a
stub for adding METHOD_ISMINMAX_CALL_LATEST later.

Fix #58215
vtjnash added a commit that referenced this pull request May 6, 2025
…ch_status enum (#58291)

The original purpose of this field was to manage quickly detecting if a
method was replaced, but that stopped being correct after #53415. It
was a fairly heavy-weight description of that single bit of
information. This bit of information allows quickly bypassing some
method lookups from pkgimages, since it can quickly detect that the
result is trivially correct (such as single-argument functions).

Also fixes #58215
serenity4 pushed a commit to serenity4/julia that referenced this pull request May 7, 2025
…ch_status enum (JuliaLang#58291)

The original purpose of this field was to manage quickly detecting if a
method was replaced, but that stopped being correct after JuliaLang#53415. It
was a fairly heavy-weight description of that single bit of
information. This bit of information allows quickly bypassing some
method lookups from pkgimages, since it can quickly detect that the
result is trivially correct (such as single-argument functions).

Also fixes JuliaLang#58215
KristofferC pushed a commit that referenced this pull request May 9, 2025
…ch_status enum (#58291)

The original purpose of this field was to manage quickly detecting if a
method was replaced, but that stopped being correct after #53415. It
was a fairly heavy-weight description of that single bit of
information. This bit of information allows quickly bypassing some
method lookups from pkgimages, since it can quickly detect that the
result is trivially correct (such as single-argument functions).

Also fixes #58215

(cherry picked from commit 5eb5155)
KristofferC pushed a commit that referenced this pull request May 12, 2025
…ch_status enum (#58291)

The original purpose of this field was to manage quickly detecting if a
method was replaced, but that stopped being correct after #53415. It
was a fairly heavy-weight description of that single bit of
information. This bit of information allows quickly bypassing some
method lookups from pkgimages, since it can quickly detect that the
result is trivially correct (such as single-argument functions).

Also fixes #58215

(cherry picked from commit 5eb5155)
charleskawczynski pushed a commit to charleskawczynski/julia that referenced this pull request May 12, 2025
…ch_status enum (JuliaLang#58291)

The original purpose of this field was to manage quickly detecting if a
method was replaced, but that stopped being correct after JuliaLang#53415. It
was a fairly heavy-weight description of that single bit of
information. This bit of information allows quickly bypassing some
method lookups from pkgimages, since it can quickly detect that the
result is trivially correct (such as single-argument functions).

Also fixes JuliaLang#58215
charleskawczynski pushed a commit to charleskawczynski/julia that referenced this pull request May 12, 2025
…ch_status enum (JuliaLang#58291)

The original purpose of this field was to manage quickly detecting if a
method was replaced, but that stopped being correct after JuliaLang#53415. It
was a fairly heavy-weight description of that single bit of
information. This bit of information allows quickly bypassing some
method lookups from pkgimages, since it can quickly detect that the
result is trivially correct (such as single-argument functions).

Also fixes JuliaLang#58215
KristofferC pushed a commit to DilumAluthgeBot/julia that referenced this pull request May 12, 2025
…ch_status enum (JuliaLang#58291)

The original purpose of this field was to manage quickly detecting if a
method was replaced, but that stopped being correct after JuliaLang#53415. It
was a fairly heavy-weight description of that single bit of
information. This bit of information allows quickly bypassing some
method lookups from pkgimages, since it can quickly detect that the
result is trivially correct (such as single-argument functions).

Also fixes JuliaLang#58215

(cherry picked from commit 5eb5155)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

types and dispatch Types, subtyping and method dispatch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants