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 @@ -1979,6 +1979,16 @@ namespace {
19791979
19801980 MetadataResponse visitExistentialType (CanExistentialType type,
19811981 DynamicMetadataRequest request) {
1982+ if (auto *PCT =
1983+ type->getConstraintType ()->getAs <ProtocolCompositionType>()) {
1984+ auto constraintTy = PCT->withoutMarkerProtocols ();
1985+ if (constraintTy->getClassOrBoundGenericClass ()) {
1986+ auto response = IGF.emitTypeMetadataRef (
1987+ constraintTy->getCanonicalType (), request);
1988+ return setLocal (type, response);
1989+ }
1990+ }
1991+
19821992 if (auto metadata = tryGetLocal (type, request))
19831993 return metadata;
19841994
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