File tree Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -1466,10 +1466,17 @@ struct InheritedEntry : public TypeLoc {
1466
1466
1467
1467
// / An entry in the "suppressed conformance" list of a type.
1468
1468
struct SuppressedEntry : public TypeLoc {
1469
- SourceLoc WithoutLoc ; // location of the "without" operator on this type.
1469
+ SourceRange WithoutRange ; // location of the "without" operator on this type.
1470
1470
1471
- SuppressedEntry (const TypeLoc &typeLoc, SourceLoc withoutLoc)
1472
- : TypeLoc(typeLoc), WithoutLoc(withoutLoc) {}
1471
+ SuppressedEntry (const TypeLoc &typeLoc, SourceRange withoutRange)
1472
+ : TypeLoc(typeLoc), WithoutRange(withoutRange) {}
1473
+
1474
+ SourceLoc getLoc () const ;
1475
+ SourceRange getSourceRange () const ;
1476
+
1477
+ SourceRange getWithoutRange () const { return WithoutRange; }
1478
+
1479
+ bool hasLocation () const { return (bool )getLoc (); }
1473
1480
};
1474
1481
1475
1482
// / ExtensionDecl - This represents a type extension containing methods
Original file line number Diff line number Diff line change @@ -1482,6 +1482,19 @@ InheritedEntry::InheritedEntry(const TypeLoc &typeLoc)
1482
1482
isUnchecked = typeRepr->findUncheckedAttrLoc ().isValid ();
1483
1483
}
1484
1484
1485
+ SourceLoc SuppressedEntry::getLoc () const {
1486
+ return WithoutRange.Start ;
1487
+ }
1488
+
1489
+ SourceRange SuppressedEntry::getSourceRange () const {
1490
+ auto range = TypeLoc::getSourceRange ();
1491
+ if (!range)
1492
+ return WithoutRange;
1493
+
1494
+ range.widen (WithoutRange);
1495
+ return range;
1496
+ }
1497
+
1485
1498
ExtensionDecl::ExtensionDecl (SourceLoc extensionLoc,
1486
1499
TypeRepr *extendedType,
1487
1500
ArrayRef<InheritedEntry> inherited,
Original file line number Diff line number Diff line change @@ -5735,14 +5735,14 @@ ParserStatus Parser::parseInheritance(
5735
5735
}
5736
5736
5737
5737
// parse the "without" operator
5738
- SourceLoc withoutLoc;
5738
+ SourceRange withoutLoc;
5739
5739
if (Tok.isTilde ()) {
5740
5740
auto loc = consumeToken ();
5741
5741
5742
5742
if (!options.contains (PI_AllowSuppression))
5743
5743
diagnose (loc, diag::suppress_illegal_here);
5744
5744
else
5745
- withoutLoc = loc;
5745
+ withoutLoc = SourceRange ( loc, loc) ;
5746
5746
}
5747
5747
5748
5748
auto ParsedTypeResult = parseType ();
You can’t perform that action at this time.
0 commit comments