mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Introduce three new requests for name lookup operations that avoid performing type checking/semantic analysis. They work using syntactic information (e.g., TypeReprs) and AST-level name lookup operations that will (eventually) avoid and calls back into type checking. The new requests are: * Retrieve the superclass declaration of a protocol or class declaration. Use this request for ClassDecl::getSuperclassDecl() and ProtocolDecl::getSuperclassDecl(). * Retrieve the types “directly referenced” by a particular location in an inheritance clause. This query is based on looking at the TypeReprs and performing fairly-minimal lookup, so it does not involve any Type computations. * Retrieve the types “directly referenced” by the underlying type of a typealias. This query allows us to desugar a typealias without forming a type. Along with these is a core operation to transform a set of TypeDecl*s into a set of NominalTypeDecl*s, looking through typealiases, and without involving Type at all. The superclass-decl request does this to find a ClassDecl; other requests will eventually do this to (e.g.) find all of the protocols mentioned in an inheritance clause.
15 KiB
15 KiB