[AST] Handle missing @ location in AtTypeAttrBase

Attributes like `nonisolated` aren't spelled with an `@`. I don't
have a test case, but this would assert if the source range were
queried.
This commit is contained in:
Hamish Knight
2025-03-27 18:46:27 +00:00
parent eaf00fecb4
commit 9fd4aa8e17

View File

@@ -3841,7 +3841,9 @@ public:
SourceLoc getAtLoc() const { return AtLoc; }
SourceLoc getStartLocImpl() const { return AtLoc; }
SourceLoc getStartLocImpl() const {
return AtLoc.isValid() ? AtLoc : getAttrLoc();
}
SourceLoc getEndLocImpl() const { return getAttrLoc(); }
};