Skip to content

Commit 3196b52

Browse files
committed
---
yaml --- r: 345535 b: refs/heads/master c: 67cdb8b h: refs/heads/master i: 345533: 6f158f5 345531: 68ebc79 345527: 1c56db8 345519: 7699ffd 345503: 49f3d78 345471: 2a9e7be
1 parent 52157a2 commit 3196b52

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 9337902d654f852fe964ac817b0eed19f1ef2877
2+
refs/heads/master: 67cdb8b6a71fba6836b20c9e4195ad7c8929271a
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/AST/ProtocolConformance.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,8 @@ NormalProtocolConformance::populateSignatureConformances() {
578578

579579
// Allocate the buffer of conformance requirements.
580580
auto &ctx = self->getProtocol()->getASTContext();
581-
buffer = ctx.AllocateUninitialized<ProtocolConformanceRef>(numConformanceRequirements);
581+
buffer = ctx.AllocateUninitialized<ProtocolConformanceRef>(
582+
numConformanceRequirements);
582583

583584
// Skip over any non-conformance requirements in the requirement
584585
// signature.
@@ -600,11 +601,20 @@ NormalProtocolConformance::populateSignatureConformances() {
600601
other.owning = false;
601602
}
602603

604+
~Writer() {
605+
if (!owning)
606+
return;
607+
while (!requirementSignature.empty())
608+
(*this)(ProtocolConformanceRef::forInvalid());
609+
}
610+
603611
void operator()(ProtocolConformanceRef conformance){
604612
// Make sure we have the right conformance.
605613
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());
608618
assert((!conformance.isConcrete() ||
609619
!conformance.getConcrete()->getType()->hasArchetype()) &&
610620
"signature conformances must use interface types");
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
}

0 commit comments

Comments
 (0)