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

Add indirection in == fallback #44678

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add indirection in == fallback #44678

wants to merge 1 commit into from

Commits on Mar 19, 2022

  1. Add indirection in == fallback

    The fallback for `==` just calls `===`. However, we also have types
    like `WeakRef` that add three specializations of `==` that just
    unwrap the `WeakRef`. It turns out this pattern is also used in
    packages, and one of them, ChainRulesCore, has >2300 dependent
    packages as of now. Unfortunately, when ChainRulesCore is loaded,
    it invalidates code that calls `==` on `WeakRef`. This includes
    much of the Serialization stdlib.
    
    This addresses the problem by defining the notion of "unwrapping
    for ==" by introducing the non-exported function `unwrap_isequal`.
    The fallback is just
    
    ```
    unwrap_isequal(x) = x
    ```
    
    but one can add specializations.
    timholy committed Mar 19, 2022
    Configuration menu
    Copy the full SHA
    a0f685a View commit details
    Browse the repository at this point in the history