Skip to content

Commit 2a76fa4

Browse files
committed
[GSB] Ensure that we have superclass constraints from merged equiv class.
Fixes one recently-found crasher. (cherry picked from commit e256a9d) (cherry picked from commit f72fec0)
1 parent 800508e commit 2a76fa4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3391,12 +3391,13 @@ GenericSignatureBuilder::addSameTypeRequirementBetweenArchetypes(
33913391
else
33923392
source2 = equivClass2->superclassConstraints.front().source;
33933393

3394-
(void)updateSuperclass(T1, equivClass2->superclass, source2);
3395-
3394+
// Add the superclass constraints from the second equivalence class.
33963395
equivClass->superclassConstraints.insert(
33973396
equivClass->superclassConstraints.end(),
33983397
equivClass2->superclassConstraints.begin(),
33993398
equivClass2->superclassConstraints.end());
3399+
3400+
(void)updateSuperclass(T1, equivClass2->superclass, source2);
34003401
}
34013402

34023403
// Add all of the protocol conformance requirements of T2 to T1.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
// See https://swift.org/LICENSE.txt for license information
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not --crash %target-swift-frontend %s -emit-ir
8+
// RUN: not %target-swift-frontend %s -emit-ir
99
protocol P{{}typealias e:a{}}class a:P=extension P{typealias e:Self

0 commit comments

Comments
 (0)