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
.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
.clangd -rw-r--r-- 114 bytes
.codecov.yml -rw-r--r-- 52 bytes
.git-blame-ignore-revs -rw-r--r-- 294 bytes
.gitattributes -rw-r--r-- 65 bytes
.gitignore -rw-r--r-- 514 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-- 23.1 KB
HISTORY.md -rw-r--r-- 363.4 KB
LICENSE.md -rw-r--r-- 1.3 KB
Make.inc -rw-r--r-- 53.0 KB
Makefile -rw-r--r-- 30.1 KB
NEWS.md -rw-r--r-- 1.7 KB
README.md -rw-r--r-- 7.3 KB
THIRDPARTY.md -rw-r--r-- 3.7 KB
VERSION -rw-r--r-- 11 bytes
julia.spdx.json -rw-r--r-- 35.8 KB
sysimage.mk -rw-r--r-- 4.1 KB

README.md

back to top