https://github.com/JuliaLang/julia
Revision b2b713d8dc918221be4a43b12d0f08cff7635eb5 authored by Keno Fischer on 11 September 2022, 01:29:20 UTC, committed by N5N3 on 31 January 2023, 12:19:35 UTC
Core.Typeof is used implicitly in the system, but for types with
free type parameters, e.g. `Vector{Core.TypeVar(:T)}`, it expects
to subsequently be wrapped in a UnionAll. In particular, it is
not in general valid to perform type queries on the result of
`Core.Typeof` (without wrapping it in a UnionAll), but we were
attempting to do so in a number of places. Of course, this is a
bit of a rare sitatuation, since we're not in a habit of passing
around types with free typevars, but since those are valid objects
I think it is better to be defensive.

This introduces `Base.TypeofValid` (better name suggestions welcome),
which is like `Core.Typeof`, except that types with free typevars
get mapped to `DataType`, rather than `Type{}` with a free typevars.
As a result, it is always valid to perform type system operations
on the result of this call.
1 parent 94c4fb5
History
Tip revision: b2b713d8dc918221be4a43b12d0f08cff7635eb5 authored by Keno Fischer on 11 September 2022, 01:29:20 UTC
Don't create Type{...} for incomplete types in most cases
Tip revision: b2b713d
File Mode Size
asan
bpftrace
mac
tsan
windows
README.md -rw-r--r-- 2.9 KB
add_license_to_files.jl -rw-r--r-- 7.0 KB
cache_stdlibs.jl -rw-r--r-- 996 bytes
check-whitespace.jl -rwxr-xr-x 1.3 KB
codesign.sh -rwxr-xr-x 1018 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 2.1 KB
fixup-libgfortran.sh -rwxr-xr-x 6.0 KB
fixup-libstdc++.sh -rwxr-xr-x 1.1 KB
fixup-rpath.sh -rwxr-xr-x 1.0 KB
generate_precompile.jl -rw-r--r-- 22.8 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.6 KB
julia.appdata.xml -rw-r--r-- 1.4 KB
julia.desktop -rw-r--r-- 367 bytes
julia.png -rw-r--r-- 1.6 KB
julia.svg -rw-r--r-- 1.1 KB
new-stdlib.sh -rwxr-xr-x 1.8 KB
normalize_triplet.py -rwxr-xr-x 4.4 KB
prepare_release.sh -rwxr-xr-x 5.0 KB
print_sorted_stdlibs.jl -rw-r--r-- 3.1 KB
refresh_checksums.mk -rw-r--r-- 6.7 KB
relative_path.py -rwxr-xr-x 537 bytes
stringreplace.c -rw-r--r-- 942 bytes
updateSPDX.jl -rw-r--r-- 1.1 KB
valgrind-julia.supp -rw-r--r-- 156 bytes

README.md

back to top