https://github.com/JuliaLang/julia
Revision bbe91dbfaa27dae35cce2b27ef68cb12ff6a1aba authored by Shuhei Kadowaki on 11 October 2021, 05:47:03 UTC, committed by KristofferC on 08 November 2021, 09:15:05 UTC
During working on the incoming lattice overhaul, I found it's quite
confusing that `TypeVar` and `Vararg` can appear in the same context
as valid `Type` objects as well as extended lattice elements.
Since it usually needs special cases to operate on `TypeVar` and `Vararg`
(e.g. they can not be used in subtyping as an obvious example), I believe
it would be great avoid bugs and catch logic errors in the future development
if we separate contexts where they can appear from ones where `Type`
objects and extended lattice elements are expected.

So this commit:
- tries to separate their context, e.g. now `TypeVar` and `Vararg` should
  not be used in `_limit_type_size`, which is supposed to return `Type`,
  but they should be handled its helper function `__limit_type_size`
- makes sure `tfunc`s don't return `TypeVar`s and `TypeVar` never spills
  into the abstract state
- makes sure `widenconst` are not called on `TypeVar` and `Vararg`,
  and now `widenconst` is ensured to return `Type` always
- and does other general refactors

(cherry picked from commit d60f92cd3a92cd12cae55893e55e6d9e14b0052e)
1 parent 9723f82
History
Tip revision: bbe91dbfaa27dae35cce2b27ef68cb12ff6a1aba authored by Shuhei Kadowaki on 11 October 2021, 05:47:03 UTC
inference: improve `TypeVar`/`Vararg` handling
Tip revision: bbe91db
File Mode Size
asan
mac
tsan
windows
README.md -rw-r--r-- 2.3 KB
add_license_to_files.jl -rw-r--r-- 6.9 KB
check-whitespace.sh -rwxr-xr-x 832 bytes
commit-name.sh -rwxr-xr-x 1.2 KB
debug_bootstrap.gdb -rw-r--r-- 76 bytes
delete-all-rpaths.sh -rwxr-xr-x 925 bytes
download_cmake.sh -rwxr-xr-x 1.7 KB
fixup-libgfortran.sh -rwxr-xr-x 6.0 KB
fixup-libstdc++.sh -rwxr-xr-x 878 bytes
fixup-rpath.sh -rwxr-xr-x 1.0 KB
generate_precompile.jl -rw-r--r-- 18.1 KB
httpbin-prod-swagger-apigateway.yaml -rw-r--r-- 3.0 KB
install.sh -rwxr-xr-x 695 bytes
julia-config.jl -rwxr-xr-x 3.8 KB
julia.appdata.xml -rw-r--r-- 1.4 KB
julia.desktop -rw-r--r-- 286 bytes
new-stdlib.sh -rwxr-xr-x 1.8 KB
normalize_triplet.py -rwxr-xr-x 4.3 KB
prepare_release.sh -rwxr-xr-x 5.0 KB
print_sorted_stdlibs.jl -rw-r--r-- 2.7 KB
refresh_checksums.mk -rw-r--r-- 6.0 KB
relative_path.py -rwxr-xr-x 536 bytes
stringreplace.c -rw-r--r-- 942 bytes

README.md

back to top