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> {
293293 continue ;
294294 }
295295
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.
297299 auto newShapeClass = getOpASTType (expansion.getCountType ());
298300 auto newShapePack = dyn_cast<PackType>(newShapeClass);
301+ if (!newShapePack)
302+ return false ;
299303
300304 // If the element has a name, then the tuple sticks around unless
301305 // the expansion disappears completely.
302306 if (type->getElement (index).hasName ()) {
303- if (newShapePack && newShapePack ->getNumElements () == 0 )
307+ if (newShapePack->getNumElements () == 0 )
304308 continue ;
305309 return false ;
306310 }
Original file line number Diff line number Diff line change @@ -295,3 +295,13 @@ public func getEmptySet() -> Set<Int> {
295295 return Set ( )
296296}
297297
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