@@ -128,10 +128,9 @@ class RecursiveTypeProperties {
128
128
// / This type expression contains a TypeVariableType.
129
129
HasTypeVariable = 0x01 ,
130
130
131
- // / This type expression contains a context-dependent archetype, either a
132
- // / \c PrimaryArchetypeType, \c OpenedArchetypeType,
133
- // / \c ElementArchetypeType, or \c PackArchetype.
134
- HasArchetype = 0x02 ,
131
+ // / This type expression contains a PrimaryArchetypeType
132
+ // / or PackArchetypeType.
133
+ HasPrimaryArchetype = 0x02 ,
135
134
136
135
// / This type expression contains a GenericTypeParamType.
137
136
HasTypeParameter = 0x04 ,
@@ -171,7 +170,7 @@ class RecursiveTypeProperties {
171
170
// / This type contains a parameterized existential type \c any P<T>.
172
171
HasParameterizedExistential = 0x2000 ,
173
172
174
- // / This type contains an ElementArchetype .
173
+ // / This type contains an ElementArchetypeType .
175
174
HasElementArchetype = 0x4000 ,
176
175
177
176
// / Whether the type is allocated in the constraint solver arena. This can
@@ -183,7 +182,7 @@ class RecursiveTypeProperties {
183
182
// / Contains a PackType.
184
183
HasPack = 0x10000 ,
185
184
186
- // / Contains a PackArchetypeType.
185
+ // / Contains a PackArchetypeType. Also implies HasPrimaryArchetype.
187
186
HasPackArchetype = 0x20000 ,
188
187
189
188
Last_Property = HasPackArchetype
@@ -205,9 +204,10 @@ class RecursiveTypeProperties {
205
204
// / variable?
206
205
bool hasTypeVariable () const { return Bits & HasTypeVariable; }
207
206
208
- // / Does a type with these properties structurally contain a
209
- // / context-dependent archetype (that is, a Primary- or OpenedArchetype)?
210
- bool hasArchetype () const { return Bits & HasArchetype; }
207
+ // / Does a type with these properties structurally contain a primary
208
+ // / or pack archetype? These are the archetypes instantiated from a
209
+ // / primary generic environment.
210
+ bool hasPrimaryArchetype () const { return Bits & HasPrimaryArchetype; }
211
211
212
212
// / Does a type with these properties structurally contain an
213
213
// / archetype from an opaque type declaration?
@@ -696,9 +696,23 @@ class alignas(1 << TypeAlignInBits) TypeBase
696
696
return getRecursiveProperties ().hasPlaceholder ();
697
697
}
698
698
699
- // / Determine whether the type involves a context-dependent archetype.
699
+ // / Determine whether the type involves a PrimaryArchetypeType *or* a
700
+ // / PackArchetypeType. These are the archetypes instantiated from a
701
+ // / primary generic environment.
702
+ bool hasPrimaryArchetype () const {
703
+ return getRecursiveProperties ().hasPrimaryArchetype ();
704
+ }
705
+
706
+ // / Whether the type contains a PackArchetypeType.
707
+ bool hasPackArchetype () const {
708
+ return getRecursiveProperties ().hasPackArchetype ();
709
+ }
710
+
711
+ // / Determine whether the type involves a primary, pack or local archetype.
712
+ // /
713
+ // / FIXME: Replace all remaining callers with a more precise check.
700
714
bool hasArchetype () const {
701
- return getRecursiveProperties (). hasArchetype ();
715
+ return hasPrimaryArchetype () || hasLocalArchetype ();
702
716
}
703
717
704
718
// / Determine whether the type involves an opened existential archetype.
@@ -727,11 +741,6 @@ class alignas(1 << TypeAlignInBits) TypeBase
727
741
return getRecursiveProperties ().hasPack ();
728
742
}
729
743
730
- // / Whether the type contains a PackArchetypeType.
731
- bool hasPackArchetype () const {
732
- return getRecursiveProperties ().hasPackArchetype ();
733
- }
734
-
735
744
// / Whether the type has any flavor of pack.
736
745
bool hasAnyPack () const {
737
746
return hasParameterPack () || hasPack () || hasPackArchetype ();
0 commit comments