mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Diagnostics] Add a getLoc method to FailureDiagnostic
This commit is contained in:
@@ -56,6 +56,8 @@ public:
|
|||||||
|
|
||||||
virtual ~FailureDiagnostic();
|
virtual ~FailureDiagnostic();
|
||||||
|
|
||||||
|
virtual SourceLoc getLoc() const { return getAnchor()->getLoc(); }
|
||||||
|
|
||||||
/// Try to diagnose a problem given affected expression,
|
/// Try to diagnose a problem given affected expression,
|
||||||
/// failure location, types and declarations deduced by
|
/// failure location, types and declarations deduced by
|
||||||
/// constraint system, and other auxiliary information.
|
/// constraint system, and other auxiliary information.
|
||||||
@@ -832,7 +834,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Compute location of the failure for diagnostic.
|
/// Compute location of the failure for diagnostic.
|
||||||
SourceLoc getLoc() const;
|
SourceLoc getLoc() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Diagnose mismatches relating to tuple destructuring.
|
/// Diagnose mismatches relating to tuple destructuring.
|
||||||
@@ -1441,7 +1443,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Compute location of the failure for diagnostic.
|
/// Compute location of the failure for diagnostic.
|
||||||
SourceLoc getLoc() const;
|
SourceLoc getLoc() const override;
|
||||||
|
|
||||||
bool isForKeyPathDynamicMemberLookup() const {
|
bool isForKeyPathDynamicMemberLookup() const {
|
||||||
return getLocator()->isForKeyPathDynamicMemberLookup();
|
return getLocator()->isForKeyPathDynamicMemberLookup();
|
||||||
@@ -1819,8 +1821,6 @@ protected:
|
|||||||
/// Are currently impossible to fix correctly,
|
/// Are currently impossible to fix correctly,
|
||||||
/// so we have to attend to that in diagnostics.
|
/// so we have to attend to that in diagnostics.
|
||||||
bool diagnoseMisplacedMissingArgument() const;
|
bool diagnoseMisplacedMissingArgument() const;
|
||||||
|
|
||||||
SourceLoc getLoc() const { return getAnchor()->getLoc(); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Replace a coercion ('as') with a forced checked cast ('as!').
|
/// Replace a coercion ('as') with a forced checked cast ('as!').
|
||||||
|
|||||||
Reference in New Issue
Block a user