File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -487,6 +487,9 @@ class TypeVariableType::Implementation {
487
487
// / expression.
488
488
bool isCodeCompletionToken () const ;
489
489
490
+ // / Determine whether this type variable represents an opened opaque type.
491
+ bool isOpaqueType () const ;
492
+
490
493
// / Retrieve the representative of the equivalence class to which this
491
494
// / type variable belongs.
492
495
// /
Original file line number Diff line number Diff line change @@ -154,6 +154,22 @@ bool TypeVariableType::Implementation::isCodeCompletionToken() const {
154
154
return locator && locator->directlyAt <CodeCompletionExpr>();
155
155
}
156
156
157
+ bool TypeVariableType::Implementation::isOpaqueType () const {
158
+ if (!locator)
159
+ return false ;
160
+
161
+ auto GP = locator->getLastElementAs <LocatorPathElt::GenericParameter>();
162
+ if (!GP)
163
+ return false ;
164
+
165
+ if (auto *GPT = GP->getType ()->getAs <GenericTypeParamType>()) {
166
+ auto *decl = GPT->getDecl ();
167
+ return decl && decl->isOpaqueType ();
168
+ }
169
+
170
+ return false ;
171
+ }
172
+
157
173
void *operator new (size_t bytes, ConstraintSystem& cs,
158
174
size_t alignment) {
159
175
return cs.getAllocator ().Allocate (bytes, alignment);
You can’t perform that action at this time.
0 commit comments