File tree Expand file tree Collapse file tree 3 files changed +18
-18
lines changed Expand file tree Collapse file tree 3 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -1576,24 +1576,6 @@ class FixedBoxTypeInfoBase : public BoxTypeInfo {
15761576 boxedInterfaceType = boxedType.mapTypeOutOfContext ();
15771577 }
15781578
1579- {
1580- // FIXME: This seems wrong. We used to just mangle opened archetypes as
1581- // their interface type. Let's make that explicit now.
1582- auto astType = boxedInterfaceType.getASTType ();
1583- astType =
1584- astType
1585- .transformRec ([](Type t) -> std::optional<Type> {
1586- if (auto *openedExistential = t->getAs <ExistentialArchetypeType>()) {
1587- auto &ctx = openedExistential->getASTContext ();
1588- return ctx.TheSelfType ;
1589- }
1590- return std::nullopt ;
1591- })
1592- ->getCanonicalType ();
1593- boxedInterfaceType = SILType::getPrimitiveType (
1594- astType, boxedInterfaceType.getCategory ());
1595- }
1596-
15971579 auto boxDescriptor = IGF.IGM .getAddrOfBoxDescriptor (
15981580 boxedInterfaceType,
15991581 env ? env->getGenericSignature ().getCanonicalSignature ()
Original file line number Diff line number Diff line change @@ -1693,6 +1693,9 @@ llvm::Constant *IRGenModule::getAddrOfFieldName(StringRef Name) {
16931693llvm::Constant *
16941694IRGenModule::getAddrOfBoxDescriptor (SILType BoxedType,
16951695 CanGenericSignature genericSig) {
1696+ if (BoxedType.hasLocalArchetype ())
1697+ return llvm::Constant::getNullValue (CaptureDescriptorPtrTy);
1698+
16961699 if (IRGen.Opts .ReflectionMetadata != ReflectionMetadataMode::Runtime)
16971700 return llvm::Constant::getNullValue (CaptureDescriptorPtrTy);
16981701
Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-frontend -emit-ir %s -target %target-swift-5.9-abi-triple
2+
3+ public protocol P { }
4+
5+ public struct G < T> : P {
6+ let s1 : String
7+ let s2 : String
8+ }
9+
10+ public func f< each T > ( t: repeat G < each T > ) {
11+ var ts : [ any P ] = [ ]
12+ for x in repeat each t {
13+ ts. append ( x)
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments