mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[NFC] Downgrade The TypeLoc in VarDecl to a TypeRepr
TypeCheckPattern used to splat the interface type into this, and different parts of the compiler would check one or the other. There is now one source of truth: The interface type. The type repr is now just a signal that the user has written an explicit type annotation on a parameter. For variables, we will eventually be able to just grab this information from the parent pattern.
This commit is contained in:
@@ -874,9 +874,9 @@ void SwiftLangSupport::printMemberDeclDescription(const swift::ValueDecl *VD,
|
||||
OS << "<#T##";
|
||||
|
||||
paramTy = paramTy.subst(substMap);
|
||||
if (paramTy->hasError() && param->getTypeLoc().hasLocation()) {
|
||||
if (paramTy->hasError() && param->getTypeRepr()) {
|
||||
// Fallback to 'TypeRepr' printing.
|
||||
param->getTypeLoc().getTypeRepr()->print(OS);
|
||||
param->getTypeRepr()->print(OS);
|
||||
} else {
|
||||
paramTy.print(OS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user