My name is Chirag Tyagi, I'm a student and a software developer with a strong interest in compiler tooling and Swift development. I am a past Google Summer of Code contributor, where I had the opportunity to work on Firebase Editor a mobile application, with CCExtractor Development, which strengthened my experience in building developer tools.
This year, I also participated in the Apple Swift Student Challenge, where I built a Swift application focused on stress management, relaxation and recreation, giving me hands-on experience with Swift syntax, type systems, and the tooling around Swift.
I'm particularly excited about the Qualified Name Lookup for Swift-Syntax project for GSoC 2025 because of its deep connection to the Swift compiler pipeline and the potential to empower tools that work with Swift source code.
To better understand the project direction and prepare a strong proposal, I had a few questions:
Any prerequisites required for contributing this year?
Will the lookup need to support generic types, associated types, or constrained extensions during resolution, or will the scope be limited to simpler member lookups for this GSoC project?
I'm enthusiastic about contributing meaningfully to this project and would greatly appreciate any guidance or suggestions you may have as I begin drafting my proposal.
Thank you for your time and putting together such a well-scoped and impactful project idea.
These will be handled at higher levels. Qualified lookup concerns itself with finding members of declarations only.
For example, if weāre asked to do a qualified lookup on a type parameter, the first step is we ask the generics system for a list of protocols the type parameter conforms to, together with its superclass bound if there is one. We then hand this list of protocols and the class to qualified lookup, which looks inside each one for a member of the given name.
Similarly, constrained extensions add new members to the lookup table of an existing type, just like unconstrained extensions. The difference is the generic signature of a constrained extension will state additional requirements. We need to check these requirements at some point to make sure theyāre actually satisfied, but we do this after we get the list of lookup results from qualified lookup.
So you can think of qualified lookup as taking a list of nominal type declarations as input, together with the name of a member. We search through these declarations, their conformed protocols and superclasses, and all extensions of all of the above, and we collect those members that have the requested name. The result is a list of member declarations, and it is up to the caller to decide what to do with them.
We also have other rules for name shadowing, disambiguating overloads, etc. Once again these are handled by the caller of the lookup, because the qualified lookup primitive just gives you a list of zero or more member declarations with the given name.
Hi @Slava_Pestov
I went through Chapters 2 (Compilation Model), 9 (Type Resolution), and 10 (Extensions) of the Swift Generics document. My key takeaway is that qualified lookup should behave as a pure member-gathering step, agnostic to type constraints or resolution logic, and solely concerned with collecting declarations by name across types, their extensions, protocols, and superclasses.
Is my understanding correct? Please do let me know if I am missing something or I should go through the documentation again.
If so, I do have an approach in my mind, should I directly include that in the proposal draft and then send it over to you or should we discuss it first?
Hi @Slava_Pestov@Douglas_Gregor , I have created a draft proposal and would be truly grateful if you could spare some time to review it. Iād highly appreciate any feedback, suggestions, or corrections you might haveāespecially around scope, technical direction, or deliverables.
Please share your email so I can share it with you, or please tell me how you would like to access it.
Just in case we donāt manage to provide additional feedback here, please make sure you submit your proposal as is! Just making sure you donāt miss the deadline :-) Slava or Doug will try to get you some feedback if possible though, thank you!