File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -247,10 +247,6 @@ bool ConstraintLocator::isForOptionalTry() const {
247
247
return directlyAt<OptionalTryExpr>();
248
248
}
249
249
250
- template <typename E> bool ConstraintLocator::directlyAt () const {
251
- return isExpr<E>(getAnchor ()) && getPath ().empty ();
252
- }
253
-
254
250
GenericTypeParamType *ConstraintLocator::getGenericParameter () const {
255
251
// Check whether we have a path that terminates at a generic parameter.
256
252
return isForGenericParameter () ?
Original file line number Diff line number Diff line change @@ -381,7 +381,11 @@ class ConstraintLocator : public llvm::FoldingSetNode {
381
381
bool isForOptionalTry () const ;
382
382
383
383
// / Determine whether this locator points directly to a given expression.
384
- template <typename E> bool directlyAt () const ;
384
+ template <typename E> bool directlyAt () const {
385
+ if (auto *expr = getAnchor ().dyn_cast <Expr *>())
386
+ return isa<E>(expr) && getPath ().empty ();
387
+ return false ;
388
+ }
385
389
386
390
// / Attempts to cast the first path element of the locator to a specific
387
391
// / \c LocatorPathElt subclass, returning \c None if either unsuccessful or
You can’t perform that action at this time.
0 commit comments