Skip to content

Commit 562d7d3

Browse files
committed
---
yaml --- r: 348601 b: refs/heads/master c: 6d6e347 h: refs/heads/master i: 348599: 5bcfb15
1 parent e3f7bf7 commit 562d7d3

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
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: f0d946690f079f34b8098e74436f8d5b106fbc9a
2+
refs/heads/master: 6d6e3477a84996c2bbf1ae9717e81a09233af63c
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/SubstitutionMap.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,15 @@ SubstitutionMap::lookupConformance(CanType type, ProtocolDecl *proto) const {
388388
if (conformance->isAbstract()) {
389389
// FIXME: Rip this out once we can get a concrete conformance from
390390
// an archetype.
391-
auto *M = proto->getParentModule();
392391
auto substType = type.subst(*this);
392+
if (substType->hasError())
393+
return ProtocolConformanceRef(proto);
394+
393395
if ((!substType->is<ArchetypeType>() ||
394396
substType->castTo<ArchetypeType>()->getSuperclass()) &&
395397
!substType->isTypeParameter() &&
396398
!substType->isExistentialType()) {
399+
auto *M = proto->getParentModule();
397400
return M->lookupConformance(substType, proto);
398401
}
399402

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// RUN: %target-swift-frontend -emit-silgen %s
2+
// FIXME: Get the above to pass with -emit-ir too.
3+
4+
public protocol P1 {
5+
associatedtype A1: P3 where A1.A4.A3: P6
6+
}
7+
8+
public protocol P12 : P1 where A1: P2 {}
9+
10+
public protocol P2 : P3 where A3 == S3<A2>, A4: P4 {}
11+
12+
public protocol P4 : P3 where A3 == S2<A2>, A4: P5 {}
13+
14+
public protocol P5: P9 where A3 == S1<A2> {}
15+
16+
public protocol P6: P11 where A2: P7 {}
17+
18+
public protocol P7: P8 {}
19+
20+
public protocol P8 {}
21+
22+
public protocol P11 {
23+
associatedtype A2 : P8
24+
}
25+
26+
public struct S1<A2 : P8> : P11 {}
27+
28+
public struct S2<A2 : P8> : P11 {}
29+
30+
extension S2: P6 where A2: P7 {}
31+
32+
public struct S3<A2 : P8> : P11 {}
33+
34+
public protocol P9 {
35+
associatedtype A2: P7
36+
associatedtype A3: P11 where A3.A2 == A2
37+
}
38+
39+
public protocol P3 : P9 {
40+
associatedtype A4: P9 where A4.A2 == A2
41+
}
42+
43+
public protocol P10 {
44+
associatedtype A3: P11 where A3.A2: P7
45+
}
46+
47+
public struct S4<T: P12> : P10 {
48+
public typealias A3 = T.A1.A4.A3
49+
}

0 commit comments

Comments
 (0)