https://github.com/JuliaLang/julia
Revision a0f685a89094f7d8499d31645ffad3692884cab1 authored by Tim Holy on 19 March 2022, 09:59:35 UTC, committed by Tim Holy on 19 March 2022, 09:59:35 UTC
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.
1 parent 802f3a3
History
Tip revision: a0f685a89094f7d8499d31645ffad3692884cab1 authored by Tim Holy on 19 March 2022, 09:59:35 UTC
Add indirection in == fallback
Tip revision: a0f685a
File Mode Size
.devcontainer
.github
base
cli
contrib
deps
doc
etc
src
stdlib
test
.buildkite-external-version -rw-r--r-- 5 bytes
.clang-format -rw-r--r-- 3.3 KB
.codecov.yml -rw-r--r-- 52 bytes
.gitattributes -rw-r--r-- 65 bytes
.gitignore -rw-r--r-- 493 bytes
.mailmap -rw-r--r-- 12.1 KB
CITATION.bib -rw-r--r-- 513 bytes
CITATION.cff -rw-r--r-- 940 bytes
CONTRIBUTING.md -rw-r--r-- 22.5 KB
HISTORY.md -rw-r--r-- 349.5 KB
LICENSE.md -rw-r--r-- 1.3 KB
Make.inc -rw-r--r-- 49.7 KB
Makefile -rw-r--r-- 26.4 KB
NEWS.md -rw-r--r-- 2.6 KB
README.md -rw-r--r-- 7.3 KB
THIRDPARTY.md -rw-r--r-- 3.7 KB
VERSION -rw-r--r-- 10 bytes
julia.spdx.json -rw-r--r-- 35.8 KB
sysimage.mk -rw-r--r-- 4.1 KB

README.md

back to top