mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Archetype builder] Canonicalize and minimize same-type constraints.
Introduce an algorithm to canonicalize and minimize same-type constraints. The algorithm itself computes the equivalence classes that would exist if all explicitly-provided same-type constraints are ignored, and then forms a minimal, canonical set of explicit same-type constraints to reform the actual equivalence class known to the type checker. This should eliminate a number of problems we've seen with inconsistently-chosen same-type constraints affecting canonicalization.
This commit is contained in:
@@ -81,7 +81,7 @@ struct IntWrapper2 : Wrapped {
|
||||
func getValue() -> Int { return 2 }
|
||||
}
|
||||
|
||||
// SIL: [[DIFFERENT_WRAPPED:%.+]] = function_ref @_T08def_func16differentWrappedSbx1a_q_1btAA0D0RzAaER_5ValueQzAFRt_r0_lF : $@convention(thin) <τ_0_0, τ_0_1 where τ_0_0 : Wrapped, τ_0_1 : Wrapped, τ_0_1.Value == τ_0_0.Value> (@in τ_0_0, @in τ_0_1) -> Bool
|
||||
// SIL: [[DIFFERENT_WRAPPED:%.+]] = function_ref @_T08def_func16differentWrappedSbx1a_q_1btAA0D0RzAaER_5ValueQy_AFRtzr0_lF : $@convention(thin) <τ_0_0, τ_0_1 where τ_0_0 : Wrapped, τ_0_1 : Wrapped, τ_0_0.Value == τ_0_1.Value> (@in τ_0_0, @in τ_0_1) -> Bool
|
||||
|
||||
|
||||
_ = differentWrapped(a: IntWrapper1(), b: IntWrapper2())
|
||||
|
||||
Reference in New Issue
Block a user