@@ -8229,27 +8229,24 @@ performMemberLookup(ConstraintKind constraintKind, DeclNameRef memberName,
8229
8229
// of the tuple.
8230
8230
auto &ctx = getASTContext();
8231
8231
if (auto baseTuple = baseObjTy->getAs<TupleType>()) {
8232
- // Tuples don't have compound-name members.
8233
- if (!memberName.isSimpleName() || memberName.isSpecial())
8234
- return result; // No result.
8235
-
8236
- StringRef nameStr = memberName.getBaseIdentifier().str();
8237
- int fieldIdx = -1;
8238
- // Resolve a number reference into the tuple type.
8239
- unsigned Value = 0;
8240
- if (!nameStr.getAsInteger(10, Value) &&
8241
- Value < baseTuple->getNumElements()) {
8242
- fieldIdx = Value;
8243
- } else {
8244
- fieldIdx = baseTuple->getNamedElementId(memberName.getBaseIdentifier());
8232
+ if (!memberName.isSpecial()) {
8233
+ StringRef nameStr = memberName.getBaseIdentifier().str();
8234
+ int fieldIdx = -1;
8235
+ // Resolve a number reference into the tuple type.
8236
+ unsigned Value = 0;
8237
+ if (!nameStr.getAsInteger(10, Value) &&
8238
+ Value < baseTuple->getNumElements()) {
8239
+ fieldIdx = Value;
8240
+ } else {
8241
+ fieldIdx = baseTuple->getNamedElementId(memberName.getBaseIdentifier());
8242
+ }
8243
+
8244
+ if (fieldIdx != -1) {
8245
+ // Add an overload set that selects this field.
8246
+ result.ViableCandidates.push_back(OverloadChoice(baseTy, fieldIdx));
8247
+ return result;
8248
+ }
8245
8249
}
8246
-
8247
- if (fieldIdx == -1)
8248
- return result; // No result.
8249
-
8250
- // Add an overload set that selects this field.
8251
- result.ViableCandidates.push_back(OverloadChoice(baseTy, fieldIdx));
8252
- return result;
8253
8250
}
8254
8251
8255
8252
if (auto *selfTy = instanceTy->getAs<DynamicSelfType>())
0 commit comments