mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Diagnostics] Always use the parameter name for closure parameter diagnostics,
because the $ prefix does not indicate that the parameter is anonymous.
This commit is contained in:
@@ -6770,13 +6770,9 @@ bool UnableToInferClosureParameterType::diagnoseAsError() {
|
||||
llvm::SmallString<16> id;
|
||||
llvm::raw_svector_ostream OS(id);
|
||||
|
||||
if (PD->isAnonClosureParam()) {
|
||||
OS << "$" << paramIdx;
|
||||
} else {
|
||||
OS << "'" << PD->getParameterName() << "'";
|
||||
}
|
||||
OS << "'" << PD->getParameterName() << "'";
|
||||
|
||||
auto loc = PD->isAnonClosureParam() ? getLoc() : PD->getLoc();
|
||||
auto loc = PD->isImplicit() ? getLoc() : PD->getLoc();
|
||||
emitDiagnosticAt(loc, diag::cannot_infer_closure_parameter_type, OS.str());
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user