[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:
Robert Widmann
2019-10-10 17:38:46 -07:00
parent 171ff440fc
commit 060cbb293f
23 changed files with 176 additions and 174 deletions

View File

@@ -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);
}