File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -1989,6 +1989,16 @@ namespace {
19891989
19901990 MetadataResponse visitExistentialType (CanExistentialType type,
19911991 DynamicMetadataRequest request) {
1992+ if (auto *PCT =
1993+ type->getConstraintType ()->getAs <ProtocolCompositionType>()) {
1994+ auto constraintTy = PCT->withoutMarkerProtocols ();
1995+ if (constraintTy->getClassOrBoundGenericClass ()) {
1996+ auto response = IGF.emitTypeMetadataRef (
1997+ constraintTy->getCanonicalType (), request);
1998+ return setLocal (type, response);
1999+ }
2000+ }
2001+
19922002 if (auto metadata = tryGetLocal (type, request))
19932003 return metadata;
19942004
Original file line number Diff line number Diff line change 2727 print ( v1 == v2)
2828 // CHECK: true
2929}
30+
31+ @_marker
32+ protocol Marker {
33+ }
34+
35+ do {
36+ print ( G< any ( C & Sendable) > . self )
37+ // CHECK: G<C>
38+
39+ class D < T> {
40+ }
41+
42+ print ( ( D< Int> & Sendable) . self)
43+ // CHECK: D<Int>
44+
45+ print ( ( D< C & Marker> & Sendable) . self)
46+ // CHECK: D<C>
47+
48+ print ( ( any Marker & Sendable ) . self)
49+ // CHECK: Any
50+
51+ print ( ( AnyObject & Sendable & Marker) . self)
52+ // CHECK: AnyObject
53+ }
You can’t perform that action at this time.
0 commit comments