julia
aa51b9d1 - Compiler: remove hasuniquerep (unsound predicate)

Commit
41 days ago
Compiler: remove hasuniquerep (unsound predicate) Remove hasuniquerep, which incorrectly claimed T == S implies T === S for concrete types. This was always unsound: degenerate UnionAll types like Union{T,S} where {T<:Int, S<:Int} are == to Int without being ===. ConstType was introduced to soundly recover the optimization. Replace all hasuniquerep call sites with the semantically correct false: - isconstType: now only matches ConstType instances - typeof_tfunc: Type{T} no longer returns Const(typeof(T)) - fieldtype_tfunc: field types wrapped in Type{} not Const() - apply_type_tfunc: returns Type{ty} not Const(ty) for Type args - tuple_tfunc: Type{T} params become Type not typeof(T) - has_nontrivial_extended_info: Const(type_val) always has info - isnotbrokensubtype: uses b <: a fallback instead Update tests: where inference precision was lost due to Type{T} no longer being treated as unique, replace Type{T} with ConstType{T} in the test to verify that ConstType correctly recovers the precision. Mark tests that depend on specTypes emitting ConstType as @test_broken. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Parents
Loading