File tree Expand file tree Collapse file tree 2 files changed +38
-11
lines changed Expand file tree Collapse file tree 2 files changed +38
-11
lines changed Original file line number Diff line number Diff line change @@ -5936,17 +5936,33 @@ llvm::TinyPtrVector<CustomAttr *> VarDecl::getAttachedPropertyWrappers() const {
5936
5936
5937
5937
// / Whether this property has any attached property wrappers.
5938
5938
bool VarDecl::hasAttachedPropertyWrapper () const {
5939
- return !getAttachedPropertyWrappers ().empty () || hasImplicitPropertyWrapper ();
5939
+ if (getAttrs ().hasAttribute <CustomAttr>()) {
5940
+ if (!getAttachedPropertyWrappers ().empty ())
5941
+ return true ;
5942
+ }
5943
+
5944
+ if (hasImplicitPropertyWrapper ())
5945
+ return true ;
5946
+
5947
+ return false ;
5940
5948
}
5941
5949
5942
5950
bool VarDecl::hasImplicitPropertyWrapper () const {
5943
- if (!getAttachedPropertyWrappers ().empty ())
5951
+ if (getAttrs ().hasAttribute <CustomAttr>()) {
5952
+ if (!getAttachedPropertyWrappers ().empty ())
5953
+ return false ;
5954
+ }
5955
+
5956
+ if (isImplicit ())
5944
5957
return false ;
5945
5958
5946
- auto *dc = getDeclContext ();
5947
- bool isClosureParam = isa<ParamDecl>(this ) &&
5948
- dc->getContextKind () == DeclContextKind::AbstractClosureExpr;
5949
- return !isImplicit () && getName ().hasDollarPrefix () && isClosureParam;
5959
+ if (!isa<ParamDecl>(this ))
5960
+ return false ;
5961
+
5962
+ if (!isa<AbstractClosureExpr>(getDeclContext ()))
5963
+ return false ;
5964
+
5965
+ return getName ().hasDollarPrefix ();
5950
5966
}
5951
5967
5952
5968
bool VarDecl::hasExternalPropertyWrapper () const {
Original file line number Diff line number Diff line change @@ -1038,11 +1038,22 @@ IterableDeclContext::castDeclToIterableDeclContext(const Decl *D) {
1038
1038
}
1039
1039
1040
1040
Optional<Fingerprint> IterableDeclContext::getBodyFingerprint () const {
1041
- auto mutableThis = const_cast <IterableDeclContext *>(this );
1042
- return evaluateOrDefault (getASTContext ().evaluator ,
1043
- ParseMembersRequest{mutableThis},
1044
- FingerprintAndMembers ())
1045
- .fingerprint ;
1041
+ auto fileUnit = dyn_cast<FileUnit>(getAsGenericContext ()->getModuleScopeContext ());
1042
+ if (!fileUnit)
1043
+ return None;
1044
+
1045
+ if (isa<SourceFile>(fileUnit)) {
1046
+ auto mutableThis = const_cast <IterableDeclContext *>(this );
1047
+ return evaluateOrDefault (getASTContext ().evaluator ,
1048
+ ParseMembersRequest{mutableThis},
1049
+ FingerprintAndMembers ())
1050
+ .fingerprint ;
1051
+ }
1052
+
1053
+ if (getDecl ()->isImplicit ())
1054
+ return None;
1055
+
1056
+ return fileUnit->loadFingerprint (this );
1046
1057
}
1047
1058
1048
1059
// / Return the DeclContext to compare when checking private access in
You can’t perform that action at this time.
0 commit comments