File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
test/SILOptimizer/Inputs/cross-module Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -293,14 +293,18 @@ class SILCloner : protected SILInstructionVisitor<ImplClass> {
293
293
continue ;
294
294
}
295
295
296
- // Substitute the shape class of the expansion.
296
+ // Substitute the shape class of the expansion. If this doesn't
297
+ // give us a pack (e.g. if this isn't a substituting clone),
298
+ // we're never erasing tuple structure.
297
299
auto newShapeClass = getOpASTType (expansion.getCountType ());
298
300
auto newShapePack = dyn_cast<PackType>(newShapeClass);
301
+ if (!newShapePack)
302
+ return false ;
299
303
300
304
// If the element has a name, then the tuple sticks around unless
301
305
// the expansion disappears completely.
302
306
if (type->getElement (index).hasName ()) {
303
- if (newShapePack && newShapePack ->getNumElements () == 0 )
307
+ if (newShapePack->getNumElements () == 0 )
304
308
continue ;
305
309
return false ;
306
310
}
Original file line number Diff line number Diff line change @@ -295,3 +295,13 @@ public func getEmptySet() -> Set<Int> {
295
295
return Set ( )
296
296
}
297
297
298
+ public protocol Visitable {
299
+ func visit( )
300
+ }
301
+ @available ( SwiftStdlib 6 . 0 , * )
302
+ public struct S < each T : Visitable > {
303
+ var storage : ( repeat each T )
304
+ public func visit( ) {
305
+ _ = ( repeat ( each storage) . visit ( ) )
306
+ }
307
+ }
You can’t perform that action at this time.
0 commit comments