File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,12 @@ getRuntimeVersionThatSupportsDemanglingType(CanType type) {
245
245
}
246
246
}
247
247
248
+ // Any composition with an inverse will need the 6.0 runtime to demangle.
249
+ if (auto pct = dyn_cast<ProtocolCompositionType>(t)) {
250
+ if (pct->hasInverse ())
251
+ return addRequirement (Swift_6_0);
252
+ }
253
+
248
254
return false ;
249
255
});
250
256
Original file line number Diff line number Diff line change @@ -126,3 +126,17 @@ func testNOTCopyableOptional() {
126
126
}
127
127
testNOTCopyableOptional ( )
128
128
// CHECK: Optional.bar(2)
129
+
130
+
131
+ // NEW: define hidden swiftcc void @"$s4main26check_existential_metatype4withyypRi_s_XPXpSg_tF"
132
+ // NEW: call ptr @__swift_instantiateConcreteTypeFromMangledName(ptr @"$sypRi_s_XPXpSgMD")
133
+ // NEW: }
134
+
135
+ // OLD: define hidden swiftcc void @"$s4main26check_existential_metatype4withyypRi_s_XPXpSg_tF"
136
+ // OLD: call swiftcc %swift.metadata_response @"$sypRi_s_XPXpSgMa"
137
+ // OLD: }
138
+ func check_existential_metatype( with x: ( any ~ Copyable. Type) ? ) {
139
+ x. map { print ( " passed type = \( $0) " ) }
140
+ }
141
+ check_existential_metatype ( with: NC . self)
142
+ // CHECK: passed type = NC
You can’t perform that action at this time.
0 commit comments