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 16
16
17
17
#include " swift/AST/TypeWalker.h"
18
18
#include " swift/AST/TypeVisitor.h"
19
+ #include " swift/AST/GenericEnvironment.h"
19
20
#include " swift/Basic/Assertions.h"
20
21
21
22
using namespace swift ;
@@ -235,17 +236,39 @@ class Traversal : public TypeVisitor<Traversal, bool>
235
236
236
237
return false ;
237
238
}
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 ;
247
253
}
248
254
}
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
249
272
return false ;
250
273
}
251
274
You can’t perform that action at this time.
0 commit comments