File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed
validation-test/IDE/crashers_2_fixed Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -578,7 +578,8 @@ NormalProtocolConformance::populateSignatureConformances() {
578
578
579
579
// Allocate the buffer of conformance requirements.
580
580
auto &ctx = self->getProtocol ()->getASTContext ();
581
- buffer = ctx.AllocateUninitialized <ProtocolConformanceRef>(numConformanceRequirements);
581
+ buffer = ctx.AllocateUninitialized <ProtocolConformanceRef>(
582
+ numConformanceRequirements);
582
583
583
584
// Skip over any non-conformance requirements in the requirement
584
585
// signature.
@@ -600,11 +601,20 @@ NormalProtocolConformance::populateSignatureConformances() {
600
601
other.owning = false ;
601
602
}
602
603
604
+ ~Writer () {
605
+ if (!owning)
606
+ return ;
607
+ while (!requirementSignature.empty ())
608
+ (*this )(ProtocolConformanceRef::forInvalid ());
609
+ }
610
+
603
611
void operator ()(ProtocolConformanceRef conformance){
604
612
// Make sure we have the right conformance.
605
613
assert (!requirementSignature.empty () && " Too many conformances?" );
606
- assert (conformance.getRequirement () ==
607
- requirementSignature.front ().getSecondType ()->castTo <ProtocolType>()->getDecl ());
614
+ assert (conformance.isInvalid () ||
615
+ conformance.getRequirement () ==
616
+ requirementSignature.front ().getSecondType ()
617
+ ->castTo <ProtocolType>()->getDecl ());
608
618
assert ((!conformance.isConcrete () ||
609
619
!conformance.getConcrete ()->getType ()->hasArchetype ()) &&
610
620
" signature conformances must use interface types" );
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename=%s
2
+
3
+ protocol ProviderP {
4
+ associatedtype Data
5
+ }
6
+
7
+ protocol BaseP { }
8
+ protocol DerivedP : BaseP {
9
+ associatedtype Provider : ProviderP
10
+
11
+ func testing( _: Provider . Data )
12
+ }
13
+
14
+ struct Concrete : DerivedP {
15
+ #^COMPLETE^#
16
+ }
You can’t perform that action at this time.
0 commit comments