Skip to content

Commit 96d6eb8

Browse files
authored
Merge pull request #82352 from drexin/wip-153681688-6.2
[6.2][IRGen] Fix placeholder logic for emission of conditionally inverted protocols
2 parents 3bacc32 + ae8c455 commit 96d6eb8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

lib/IRGen/GenMeta.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,12 +1394,13 @@ namespace {
13941394

13951395
// Create placeholders for the counts of the conditional requirements
13961396
// for each conditional conformance to a supressible protocol.
1397-
unsigned numProtocols = countBitsUsed(protocols.rawBits());
1397+
unsigned numProtocols = 0;
13981398
using PlaceholderPosition =
13991399
ConstantAggregateBuilderBase::PlaceholderPosition;
14001400
SmallVector<PlaceholderPosition, 2> countPlaceholders;
1401-
for (unsigned i : range(0, numProtocols)) {
1402-
(void)i;
1401+
for (auto kind : protocols) {
1402+
(void)kind;
1403+
numProtocols++;
14031404
countPlaceholders.push_back(
14041405
B.addPlaceholderWithSize(IGM.Int16Ty));
14051406
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %target-swift-frontend %s -target %target-swift-5.9-abi-triple -emit-ir
2+
3+
public enum Enum<T : ~Escapable> : ~Escapable {
4+
case none
5+
case some(T)
6+
}
7+
8+
extension Enum: Escapable where T: Escapable {}

0 commit comments

Comments
 (0)