mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
* Add constraints to FixedWidthInteger.Stride and .Magnitude Add the constraint that these associatedtypes themselves conform to FixedWidthInteger and to SignedInteger and UnsignedInteger, respectively. These are effectively part of the semantic requirement of the protocol already, because the requirements on .min and .max effectively force FixedWidthInteger to be twos-complement, which requires Magnitude not be Self for signed types. Also, in practice it's generally necessary to have these two constraints in order to effectively use the FixedWidthInteger protocol anyway; witness that by adding them to the protocol, we eliminate them as constraints from a number of extensions. This also resolves https://bugs.swift.org/browse/SR-8156
7.5 KiB
7.5 KiB