@@ -107,15 +107,15 @@ public enum TypeConstruction {
107
107
var currentElementAddressUnaligned = UnsafeMutableRawPointer ( baseAddress)
108
108
for element in elements {
109
109
// Open existential on each element type.
110
- func initializeElement< T > ( _ element: T ) {
110
+ func initializeElement< U > ( _ element: U ) {
111
111
currentElementAddressUnaligned =
112
- currentElementAddressUnaligned. roundedUp ( toAlignmentOf: T . self)
112
+ currentElementAddressUnaligned. roundedUp ( toAlignmentOf: U . self)
113
113
currentElementAddressUnaligned. bindMemory (
114
- to: T . self, capacity: MemoryLayout< T > . size
114
+ to: U . self, capacity: MemoryLayout< U > . size
115
115
) . initialize ( to: element)
116
116
// Advance to the next element (unaligned).
117
117
currentElementAddressUnaligned =
118
- currentElementAddressUnaligned. advanced ( by: MemoryLayout< T > . size)
118
+ currentElementAddressUnaligned. advanced ( by: MemoryLayout< U > . size)
119
119
}
120
120
_openExistential ( element, do: initializeElement)
121
121
}
@@ -175,8 +175,8 @@ extension MemoryLayout {
175
175
if byteOffset == 0 { return 0 }
176
176
var currentOffset = 0
177
177
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 )
180
180
}
181
181
// The ABI of an offset-based key path only stores the byte offset, so
182
182
// this doesn't work if there's a 0-sized element, e.g. `Void`,
0 commit comments