mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CSDiagnostics] Use expr's start loc for 'self.' fix-it
Resolves SR-11787.
This commit is contained in:
@@ -1647,9 +1647,10 @@ bool AssignmentFailure::diagnoseAsError() {
|
||||
});
|
||||
|
||||
if (foundProperty != results.end()) {
|
||||
emitDiagnostic(Loc, diag::masked_instance_variable,
|
||||
auto startLoc = immutableExpr->getStartLoc();
|
||||
emitDiagnostic(startLoc, diag::masked_instance_variable,
|
||||
typeContext->getSelfTypeInContext())
|
||||
.fixItInsert(Loc, "self.");
|
||||
.fixItInsert(startLoc, "self.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user