File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -900,20 +900,24 @@ class alignas(1 << TypeAlignInBits) TypeBase
900
900
bool satisfiesClassConstraint ();
901
901
902
902
// / Determine whether this type can be used as a base type for AST
903
- // / name lookup, which is the case for nominal types, protocol compositions
904
- // / and archetypes .
903
+ // / name lookup, which is the case for nominal types, existential types,
904
+ // / archetypes, and tuples .
905
905
// /
906
906
// / Generally, the static vs instance and mutating vs nonmutating distinction
907
907
// / is handled elsewhere, so metatypes, lvalue types and inout types are not
908
908
// / allowed here.
909
909
// /
910
- // / Similarly, tuples formally have members, but this does not go through
911
- // / name lookup.
910
+ // / Tuples have formal members to project elements by index or by label; these
911
+ // / are handled directly by Sema and do not go through name lookup.
912
+ // /
913
+ // / Bona fide members on tuples are defined on extensions of
914
+ // / Builtin.TheTupleType.
912
915
bool mayHaveMembers () {
913
916
return (is<ArchetypeType>() ||
914
917
is<ModuleType>() ||
915
918
isExistentialType () ||
916
- getAnyNominal ());
919
+ getAnyNominal () ||
920
+ is<TupleType>());
917
921
}
918
922
919
923
// / Checks whether this type may potentially be callable. This returns true
You can’t perform that action at this time.
0 commit comments