File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -4861,7 +4861,7 @@ class KeyPathExpr : public Expr {
4861
4861
Expr *indexExpr,
4862
4862
ArrayRef<Identifier> subscriptLabels,
4863
4863
ArrayRef<ProtocolConformanceRef> indexHashables,
4864
- unsigned fieldNumber ,
4864
+ unsigned tupleIndex ,
4865
4865
Kind kind,
4866
4866
Type type,
4867
4867
SourceLoc loc);
Original file line number Diff line number Diff line change @@ -2185,7 +2185,7 @@ KeyPathExpr::Component::Component(ASTContext *ctxForCopyingLabels,
2185
2185
Expr *indexExpr,
2186
2186
ArrayRef<Identifier> subscriptLabels,
2187
2187
ArrayRef<ProtocolConformanceRef> indexHashables,
2188
- unsigned fieldNumber ,
2188
+ unsigned tupleIndex ,
2189
2189
Kind kind,
2190
2190
Type type,
2191
2191
SourceLoc loc)
@@ -2194,13 +2194,15 @@ KeyPathExpr::Component::Component(ASTContext *ctxForCopyingLabels,
2194
2194
{
2195
2195
assert (subscriptLabels.size () == indexHashables.size ()
2196
2196
|| indexHashables.empty ());
2197
- assert (subscriptLabels.empty () || fieldNumber == 0 );
2198
2197
SubscriptLabelsData = subscriptLabels.data ();
2199
2198
SubscriptHashableConformancesData = indexHashables.empty ()
2200
2199
? nullptr : indexHashables.data ();
2200
+
2201
+ if (kind == Kind::TupleElement) {
2202
+ assert (subscriptLabels.empty ()
2203
+ && " subscript labels not empty for tuple element" );
2201
2204
2202
- if (subscriptLabels.empty ()) {
2203
- TupleIndex = fieldNumber;
2205
+ TupleIndex = tupleIndex;
2204
2206
} else {
2205
2207
SubscriptSize = subscriptLabels.size ();
2206
2208
}
You can’t perform that action at this time.
0 commit comments