mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Fix MissingCallFailure::diagnoseAsError() crash with special base names
This commit is contained in:
@@ -3940,14 +3940,14 @@ bool MissingCallFailure::diagnoseAsError() {
|
||||
|
||||
if (auto *DRE = getAsExpr<DeclRefExpr>(anchor)) {
|
||||
emitDiagnostic(diag::did_not_call_function,
|
||||
DRE->getDecl()->getBaseIdentifier())
|
||||
DRE->getDecl()->getBaseName())
|
||||
.fixItInsertAfter(insertLoc, "()");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (auto *UDE = getAsExpr<UnresolvedDotExpr>(anchor)) {
|
||||
emitDiagnostic(diag::did_not_call_method,
|
||||
UDE->getName().getBaseIdentifier())
|
||||
UDE->getName().getBaseName())
|
||||
.fixItInsertAfter(insertLoc, "()");
|
||||
return true;
|
||||
}
|
||||
@@ -3955,7 +3955,7 @@ bool MissingCallFailure::diagnoseAsError() {
|
||||
if (auto *DSCE = getAsExpr<DotSyntaxCallExpr>(anchor)) {
|
||||
if (auto *DRE = dyn_cast<DeclRefExpr>(DSCE->getFn())) {
|
||||
emitDiagnostic(diag::did_not_call_method,
|
||||
DRE->getDecl()->getBaseIdentifier())
|
||||
DRE->getDecl()->getBaseName())
|
||||
.fixItInsertAfter(insertLoc, "()");
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user