mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Delaying such bindings is too restrictive and leads to subpar selections. For `$T1` to be array or C-style pointer it would have to be connected either to a type variable that could be bound to array/pointer or directly to array/pointer type which would result in the solver either selecting the other type variable first (because it appears in adjacent variables of `$T1`) or provide an additional binding(s) for `$T1` (including literals). Consider the following constraint system: ``` $T2 arg conv $T1 $T2 conforms ExpressibleByIntegerLiteral inout $T1 arg conv UnsafeMutablePointer<UInt8>? ``` If `$T1` and `$T2` are the only viable type variables delaying `$T1` would mean that `$T2` is picked to attempt its default type `Int` which is incorrect (it doesn't get `UInt8` because there is no transitive inference through conversions).
3.3 KiB
3.3 KiB