File tree Expand file tree Collapse file tree 1 file changed +32
-9
lines changed Expand file tree Collapse file tree 1 file changed +32
-9
lines changed Original file line number Diff line number Diff line change 1616
1717#include " swift/AST/TypeWalker.h"
1818#include " swift/AST/TypeVisitor.h"
19+ #include " swift/AST/GenericEnvironment.h"
1920#include " swift/Basic/Assertions.h"
2021
2122using namespace swift ;
@@ -235,17 +236,39 @@ class Traversal : public TypeVisitor<Traversal, bool>
235236
236237 return false ;
237238 }
238-
239- bool visitArchetypeType (ArchetypeType *ty) {
240- // If the root is an opaque archetype, visit its substitution replacement
241- // types.
242- if (auto opaque = dyn_cast<OpaqueTypeArchetypeType>(ty)) {
243- for (auto arg : opaque->getSubstitutions ().getReplacementTypes ()) {
244- if (doIt (arg)) {
245- return true ;
246- }
239+
240+ bool visitPrimaryArchetypeType (PrimaryArchetypeType *ty) {
241+ return false ;
242+ }
243+
244+ bool visitPackArchetypeType (PackArchetypeType *ty) {
245+ return false ;
246+ }
247+
248+ bool visitOpaqueTypeArchetypeType (OpaqueTypeArchetypeType *opaque) {
249+ auto *env = opaque->getGenericEnvironment ();
250+ for (auto arg : env->getOuterSubstitutions ().getReplacementTypes ()) {
251+ if (doIt (arg)) {
252+ return true ;
247253 }
248254 }
255+
256+ return false ;
257+ }
258+
259+ bool visitOpenedArchetypeType (OpenedArchetypeType *opened) {
260+ auto *env = opened->getGenericEnvironment ();
261+ for (auto arg : env->getOuterSubstitutions ().getReplacementTypes ()) {
262+ if (doIt (arg)) {
263+ return true ;
264+ }
265+ }
266+
267+ return false ;
268+ }
269+
270+ bool visitElementArchetypeType (ElementArchetypeType *element) {
271+ // FIXME: Visit element type substitutions here
249272 return false ;
250273 }
251274
You can’t perform that action at this time.
0 commit comments