Skip to content

Commit 6a462b1

Browse files
committed
Made a union in KeyPathExpr anonymous
1 parent 17cf136 commit 6a462b1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/swift/AST/Expr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4850,7 +4850,7 @@ class KeyPathExpr : public Expr {
48504850
union {
48514851
unsigned SubscriptSize;
48524852
unsigned TupleIndex;
4853-
} technicated;
4853+
};
48544854

48554855
Kind KindValue;
48564856
Type ComponentType;
@@ -5050,7 +5050,7 @@ class KeyPathExpr : public Expr {
50505050
switch (getKind()) {
50515051
case Kind::Subscript:
50525052
case Kind::UnresolvedSubscript:
5053-
return {SubscriptLabelsData, (size_t)technicated.SubscriptSize};
5053+
return {SubscriptLabelsData, (size_t)SubscriptSize};
50545054

50555055
case Kind::Invalid:
50565056
case Kind::OptionalChain:
@@ -5071,7 +5071,7 @@ class KeyPathExpr : public Expr {
50715071
case Kind::Subscript:
50725072
if (!SubscriptHashableConformancesData)
50735073
return {};
5074-
return {SubscriptHashableConformancesData, (size_t)technicated.SubscriptSize};
5074+
return {SubscriptHashableConformancesData, (size_t)SubscriptSize};
50755075

50765076
case Kind::UnresolvedSubscript:
50775077
case Kind::Invalid:
@@ -5131,7 +5131,7 @@ class KeyPathExpr : public Expr {
51315131
unsigned getTupleIndex() const {
51325132
switch (getKind()) {
51335133
case Kind::TupleElement:
5134-
return technicated.TupleIndex;
5134+
return TupleIndex;
51355135

51365136
case Kind::Invalid:
51375137
case Kind::UnresolvedProperty:

lib/AST/Expr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,9 +2200,9 @@ KeyPathExpr::Component::Component(ASTContext *ctxForCopyingLabels,
22002200
? nullptr : indexHashables.data();
22012201

22022202
if (subscriptLabels.empty()) {
2203-
technicated.TupleIndex = fieldNumber;
2203+
TupleIndex = fieldNumber;
22042204
} else {
2205-
technicated.SubscriptSize = subscriptLabels.size();
2205+
SubscriptSize = subscriptLabels.size();
22062206
}
22072207
}
22082208

@@ -2220,7 +2220,7 @@ void KeyPathExpr::Component::setSubscriptIndexHashableConformances(
22202220
ArrayRef<ProtocolConformanceRef> hashables) {
22212221
switch (getKind()) {
22222222
case Kind::Subscript:
2223-
assert(hashables.size() == technicated.SubscriptSize);
2223+
assert(hashables.size() == SubscriptSize);
22242224
SubscriptHashableConformancesData = getComponentType()->getASTContext()
22252225
.AllocateCopy(hashables)
22262226
.data();

0 commit comments

Comments
 (0)