@@ -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
@@ -205,9 +204,9 @@ 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
+ // / archetype?
209
+ bool hasPrimaryArchetype () const { return Bits & HasPrimaryArchetype ; }
211
210
212
211
// / Does a type with these properties structurally contain an
213
212
// / archetype from an opaque type declaration?
@@ -696,9 +695,21 @@ class alignas(1 << TypeAlignInBits) TypeBase
696
695
return getRecursiveProperties ().hasPlaceholder ();
697
696
}
698
697
699
- // / Determine whether the type involves a context-dependent archetype.
698
+ // / Determine whether the type involves a primary archetype.
699
+ bool hasPrimaryArchetype () const {
700
+ return getRecursiveProperties ().hasPrimaryArchetype ();
701
+ }
702
+
703
+ // / Whether the type contains a PackArchetypeType.
704
+ bool hasPackArchetype () const {
705
+ return getRecursiveProperties ().hasPackArchetype ();
706
+ }
707
+
708
+ // / Determine whether the type involves a primary, pack or local archetype.
709
+ // /
710
+ // / FIXME: Replace all remaining callers with a more precise check.
700
711
bool hasArchetype () const {
701
- return getRecursiveProperties (). hasArchetype ();
712
+ return hasPrimaryArchetype () || hasLocalArchetype ();
702
713
}
703
714
704
715
// / Determine whether the type involves an opened existential archetype.
@@ -727,11 +738,6 @@ class alignas(1 << TypeAlignInBits) TypeBase
727
738
return getRecursiveProperties ().hasPack ();
728
739
}
729
740
730
- // / Whether the type contains a PackArchetypeType.
731
- bool hasPackArchetype () const {
732
- return getRecursiveProperties ().hasPackArchetype ();
733
- }
734
-
735
741
// / Whether the type has any flavor of pack.
736
742
bool hasAnyPack () const {
737
743
return hasParameterPack () || hasPack () || hasPackArchetype ();
0 commit comments