@@ -107,15 +107,15 @@ public enum TypeConstruction {
107107 var currentElementAddressUnaligned = UnsafeMutableRawPointer ( baseAddress)
108108 for element in elements {
109109 // Open existential on each element type.
110- func initializeElement< T > ( _ element: T ) {
110+ func initializeElement< U > ( _ element: U ) {
111111 currentElementAddressUnaligned =
112- currentElementAddressUnaligned. roundedUp ( toAlignmentOf: T . self)
112+ currentElementAddressUnaligned. roundedUp ( toAlignmentOf: U . self)
113113 currentElementAddressUnaligned. bindMemory (
114- to: T . self, capacity: MemoryLayout< T > . size
114+ to: U . self, capacity: MemoryLayout< U > . size
115115 ) . initialize ( to: element)
116116 // Advance to the next element (unaligned).
117117 currentElementAddressUnaligned =
118- currentElementAddressUnaligned. advanced ( by: MemoryLayout< T > . size)
118+ currentElementAddressUnaligned. advanced ( by: MemoryLayout< U > . size)
119119 }
120120 _openExistential ( element, do: initializeElement)
121121 }
@@ -175,8 +175,8 @@ extension MemoryLayout {
175175 if byteOffset == 0 { return 0 }
176176 var currentOffset = 0
177177 for (index, type) in elementTypes. enumerated ( ) {
178- func sizeAndAlignMask< T > ( _: T . Type ) -> ( Int , Int ) {
179- ( MemoryLayout < T > . size, MemoryLayout < T > . alignment - 1 )
178+ func sizeAndAlignMask< U > ( _: U . Type ) -> ( Int , Int ) {
179+ ( MemoryLayout < U > . size, MemoryLayout < U > . alignment - 1 )
180180 }
181181 // The ABI of an offset-based key path only stores the byte offset, so
182182 // this doesn't work if there's a 0-sized element, e.g. `Void`,
0 commit comments