File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6417,6 +6417,10 @@ class AccessorDecl final : public FuncDecl {
6417
6417
llvm_unreachable (" bad accessor kind" );
6418
6418
}
6419
6419
6420
+ bool isImplicitGetter () const {
6421
+ return isGetter () && getAccessorKeywordLoc ().isInvalid ();
6422
+ }
6423
+
6420
6424
void setIsTransparent (bool transparent) {
6421
6425
Bits.AccessorDecl .IsTransparent = transparent;
6422
6426
Bits.AccessorDecl .IsTransparentComputed = 1 ;
Original file line number Diff line number Diff line change @@ -520,7 +520,7 @@ SourceRange Decl::getSourceRangeIncludingAttrs() const {
520
520
// e.g. 'override'.
521
521
if (auto *AD = dyn_cast<AccessorDecl>(this )) {
522
522
// If this is implicit getter, accessor range should not include attributes.
523
- if (! AD->getAccessorKeywordLoc (). isValid ())
523
+ if (AD->isImplicitGetter ())
524
524
return Range;
525
525
526
526
// Otherwise, include attributes directly attached to the accessor.
@@ -5937,7 +5937,7 @@ void VarDecl::emitLetToVarNoteIfSimple(DeclContext *UseDC) const {
5937
5937
->hasReferenceSemantics ()) {
5938
5938
// Do not suggest the fix-it in implicit getters
5939
5939
if (auto AD = dyn_cast<AccessorDecl>(FD)) {
5940
- if (AD->isGetter () && !AD-> getAccessorKeywordLoc (). isValid ())
5940
+ if (AD->isImplicitGetter ())
5941
5941
return ;
5942
5942
}
5943
5943
You can’t perform that action at this time.
0 commit comments