File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -4215,6 +4215,12 @@ void ASTMangler::appendAnyProtocolConformance(
42154215 conformance.getRequirement ()->isMarkerProtocol ())
42164216 return ;
42174217
4218+ // While all invertible protocols are marker protocols, do not mangle them for
4219+ // compatability reasons. See equivalent hack in `conformanceRequirementIndex`
4220+ // where only invertible protocols are unconditionally skipped.
4221+ if (conformance.getRequirement ()->getInvertibleProtocolKind ())
4222+ return ;
4223+
42184224 if (conformingType->isTypeParameter ()) {
42194225 assert (genericSig && " Need a generic signature to resolve conformance" );
42204226 auto path = genericSig->getConformancePath (conformingType,
Original file line number Diff line number Diff line change 1+ // RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking) | %FileCheck %s
2+ // RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -O) | %FileCheck %s
3+
4+ // REQUIRES: executable_test
5+
6+ // UNSUPPORTED: use_os_stdlib
7+ // UNSUPPORTED: back_deployment_runtime
8+
9+ protocol Marked {
10+ func announce( )
11+ }
12+ extension Marked {
13+ func announce( ) { print ( " \( Self . self) is Marked " ) }
14+ }
15+
16+ struct ConcreteWrapper < Wrapped> { }
17+ extension ConcreteWrapper : Marked where Wrapped: Marked { }
18+
19+ struct Hello < T: ~ Copyable> { }
20+ extension Hello : Marked { }
21+
22+ func makeWrapper< P> ( wrapping _: P . Type ) -> some Marked {
23+ ConcreteWrapper < Hello < P > > ( )
24+ }
25+
26+ do {
27+ let markedVal = makeWrapper ( wrapping: String . self)
28+ markedVal. announce ( ) // CHECK: ConcreteWrapper<Hello<String>> is Marked
29+ }
You can’t perform that action at this time.
0 commit comments