File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -2608,6 +2608,9 @@ class ValueDecl : public Decl {
2608
2608
// / if the base declaration is \c open, the override might have to be too.
2609
2609
bool hasOpenAccess (const DeclContext *useDC) const ;
2610
2610
2611
+ // / FIXME: This is deprecated.
2612
+ bool isRecursiveValidation () const ;
2613
+
2611
2614
// / Retrieve the "interface" type of this value, which uses
2612
2615
// / GenericTypeParamType if the declaration is generic. For a generic
2613
2616
// / function, this will have a GenericFunctionType with a
Original file line number Diff line number Diff line change @@ -2705,6 +2705,27 @@ bool ValueDecl::hasInterfaceType() const {
2705
2705
return !TypeAndAccess.getPointer ().isNull ();
2706
2706
}
2707
2707
2708
+ bool ValueDecl::isRecursiveValidation () const {
2709
+ if (hasValidationStarted () || !hasInterfaceType ())
2710
+ return true ;
2711
+
2712
+ if (auto *vd = dyn_cast<VarDecl>(this ))
2713
+ if (auto *pbd = vd->getParentPatternBinding ())
2714
+ if (pbd->isBeingValidated ())
2715
+ return true ;
2716
+
2717
+ auto *dc = getDeclContext ();
2718
+ while (isa<NominalTypeDecl>(dc))
2719
+ dc = dc->getParent ();
2720
+
2721
+ if (auto *ext = dyn_cast<ExtensionDecl>(dc)) {
2722
+ if (ext->isComputingGenericSignature ())
2723
+ return true ;
2724
+ }
2725
+
2726
+ return false ;
2727
+ }
2728
+
2708
2729
Type ValueDecl::getInterfaceType () const {
2709
2730
if (!hasInterfaceType ()) {
2710
2731
// Our clients that don't register the lazy resolver are relying on the
You can’t perform that action at this time.
0 commit comments