Skip to content

Commit 814e573

Browse files
committed
---
yaml --- r: 345976 b: refs/heads/master c: 8177651 h: refs/heads/master
1 parent 78b87b2 commit 814e573

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
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: 74cfb32a3d5e9f84a558d8a01c2f9dd9d9d8f54b
2+
refs/heads/master: 8177651ebe0984f0d81cd1db53cb1c7821570693
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: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,21 @@ ProtocolConformanceRef::subst(Type origType,
114114

115115
auto *proto = getRequirement();
116116

117+
// If the type is an existential, it must be self-conforming.
118+
if (substType->isExistentialType()) {
119+
auto optConformance =
120+
proto->getModuleContext()->lookupExistentialConformance(substType, proto);
121+
assert(optConformance && "existential type didn't self-conform");
122+
return *optConformance;
123+
}
124+
117125
// Check the conformance map.
118126
if (auto result = conformances(origType->getCanonicalType(),
119127
substType, proto)) {
120128
return *result;
121129
}
122130

123-
// The only remaining case is that the type is an existential that
124-
// self-conforms.
125-
assert(substType->isExistentialType());
126-
auto optConformance =
127-
proto->getModuleContext()->lookupExistentialConformance(substType, proto);
128-
assert(optConformance && "existential type didn't self-conform");
129-
return *optConformance;
131+
llvm_unreachable("Invalid conformance substitution");
130132
}
131133

132134
Type

0 commit comments

Comments
 (0)