mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST printing: take more care to only escape 'Self' when needed.
Cleans up AST printing somewhat as well as providing slightly better type-to-declaration mappings for annotated AST printing and indexing. Swift SVN r32420
This commit is contained in:
@@ -2049,6 +2049,14 @@ SourceRange GenericTypeParamDecl::getSourceRange() const {
|
||||
return SourceRange(getNameLoc(), endLoc);
|
||||
}
|
||||
|
||||
bool GenericTypeParamDecl::isProtocolSelf() const {
|
||||
if (!isImplicit()) return false;
|
||||
auto dc = getDeclContext();
|
||||
if (!dc->isProtocolOrProtocolExtensionContext()) return false;
|
||||
return dc->getProtocolSelf() == this;
|
||||
}
|
||||
|
||||
|
||||
AssociatedTypeDecl::AssociatedTypeDecl(DeclContext *dc, SourceLoc keywordLoc,
|
||||
Identifier name, SourceLoc nameLoc,
|
||||
TypeLoc defaultDefinition)
|
||||
|
||||
Reference in New Issue
Block a user