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 {
1576
1576
boxedInterfaceType = boxedType.mapTypeOutOfContext ();
1577
1577
}
1578
1578
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
-
1597
1579
auto boxDescriptor = IGF.IGM .getAddrOfBoxDescriptor (
1598
1580
boxedInterfaceType,
1599
1581
env ? env->getGenericSignature ().getCanonicalSignature ()
Original file line number Diff line number Diff line change @@ -1693,6 +1693,9 @@ llvm::Constant *IRGenModule::getAddrOfFieldName(StringRef Name) {
1693
1693
llvm::Constant *
1694
1694
IRGenModule::getAddrOfBoxDescriptor (SILType BoxedType,
1695
1695
CanGenericSignature genericSig) {
1696
+ if (BoxedType.hasLocalArchetype ())
1697
+ return llvm::Constant::getNullValue (CaptureDescriptorPtrTy);
1698
+
1696
1699
if (IRGen.Opts .ReflectionMetadata != ReflectionMetadataMode::Runtime)
1697
1700
return llvm::Constant::getNullValue (CaptureDescriptorPtrTy);
1698
1701
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