File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,10 @@ concept HasSourceRangeOnly = requires(T e) {
4040&&(!HasStartAndEndLoc<T>)&&(!HasOneLoc<T>);
4141
4242swift::SourceRange getSourceRange (const HasStartAndEndLoc auto & locatable) {
43- return {locatable.getStartLoc (), locatable.getEndLoc ()};
43+ if (locatable.getStartLoc () && locatable.getEndLoc ()) {
44+ return {locatable.getStartLoc (), locatable.getEndLoc ()};
45+ }
46+ return {};
4447}
4548
4649swift::SourceRange getSourceRange (const HasOneLoc auto & locatable) {
@@ -64,7 +67,10 @@ swift::SourceRange getSourceRange(const llvm::MutableArrayRef<Locatable>& locata
6467 }
6568 auto startRange = getSourceRange (locatables.front ());
6669 auto endRange = getSourceRange (locatables.back ());
67- return {startRange.Start , endRange.End };
70+ if (startRange.Start && endRange.End ) {
71+ return {startRange.Start , endRange.End };
72+ }
73+ return {};
6874}
6975} // namespace detail
7076
You can’t perform that action at this time.
0 commit comments