Skip to content

Commit 68f8747

Browse files
committed
[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.
1 parent b45b039 commit 68f8747

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/swift/AST/Attr.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3841,7 +3841,9 @@ class AtTypeAttrBase : public TypeAttribute {
38413841

38423842
SourceLoc getAtLoc() const { return AtLoc; }
38433843

3844-
SourceLoc getStartLocImpl() const { return AtLoc; }
3844+
SourceLoc getStartLocImpl() const {
3845+
return AtLoc.isValid() ? AtLoc : getAttrLoc();
3846+
}
38453847
SourceLoc getEndLocImpl() const { return getAttrLoc(); }
38463848
};
38473849

0 commit comments

Comments
 (0)