mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ModuleInterfaces] Escape Type and Protocol when module-qualifying
If we see `MyModule.Type`, the parser thinks this is a metatype type. Escape the name `Type` so the parser can recognize it's a type name. Fixes [SR-11422](https://bugs.swift.org/browse/SR-11422) rdar://55094784
This commit is contained in:
@@ -241,10 +241,12 @@ public:
|
||||
deinitDefaultMapToUse(D);
|
||||
}
|
||||
|
||||
void printTypeRef(Type T, const TypeDecl *TD, Identifier Name) override {
|
||||
void printTypeRef(
|
||||
Type T, const TypeDecl *TD, Identifier Name,
|
||||
PrintNameContext NameContext = PrintNameContext::Normal) override {
|
||||
unsigned StartOffset = OS.tell();
|
||||
References.emplace_back(TD, StartOffset, Name.str().size());
|
||||
StreamPrinter::printTypeRef(T, TD, Name);
|
||||
StreamPrinter::printTypeRef(T, TD, Name, NameContext);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user