julia
e7fe47b0 - type system: Add TypeEgal kind (#62001)

Commit
24 days ago
type system: Add TypeEgal kind (#62001) Now that #61915 is merged, we can start cleaning up type system soundness issues to start, we need to separate `Type{}` (now TypeEq) from its type equality use and the use in the cache and inference that used `Type{}` to mean "exactly this type (by egality). To do that, introduce a new kind `Core.TypeEgal{T}`, as an egality-based dual of `TypeEq{T}` (`Type{T}`): its sole instance is exactly `T` matched by `===` rather than `==`, and free typevars are disallowed inside it. The dispatch cache now specializes type-valued arguments on `TypeEgal` instead of `TypeEq`, so type-equal but distinct (`==` yet `!==`) type objects receive distinct cache entries and method specializations. As a particular consequence, this lets us remove the unsound `hasuniquerep` predicate that we were using to lift `Type` back to Const. Fixes #61323. --------- Co-authored-by: Keno Fischer <Keno@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: OpenAI Codex <codex@openai.com>
Author
Parents
Loading