mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Combine various ownership TypeReprs into one OwnershipTypeRepr.
This lets us consolidate code paths that mostly run in parallel over the existing InOutTypeRepr/SharedTypeRepr/OwnedTypeRepr family of types. This patch by itself is NFC but makes it easier to introduce new spellings, particularly the newly-official `borrowing` and `consuming` modifiers that were approved in SE-0377.
This commit is contained in:
@@ -917,8 +917,8 @@ static void addParameters(ArrayRef<Identifier> &ArgNames,
|
||||
|
||||
if (auto typeRepr = param->getTypeRepr()) {
|
||||
SourceRange TypeRange = typeRepr->getSourceRange();
|
||||
if (auto InOutTyR = dyn_cast_or_null<InOutTypeRepr>(typeRepr))
|
||||
TypeRange = InOutTyR->getBase()->getSourceRange();
|
||||
if (auto OwnTyR = dyn_cast_or_null<OwnershipTypeRepr>(typeRepr))
|
||||
TypeRange = OwnTyR->getBase()->getSourceRange();
|
||||
if (TypeRange.isInvalid())
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user