@@ -56,6 +56,8 @@ class FailureDiagnostic {
56
56
57
57
virtual ~FailureDiagnostic ();
58
58
59
+ virtual SourceLoc getLoc () const { return getAnchor ()->getLoc (); }
60
+
59
61
// / Try to diagnose a problem given affected expression,
60
62
// / failure location, types and declarations deduced by
61
63
// / constraint system, and other auxiliary information.
@@ -832,7 +834,7 @@ class InvalidUseOfAddressOf final : public ContextualFailure {
832
834
833
835
protected:
834
836
// / Compute location of the failure for diagnostic.
835
- SourceLoc getLoc () const ;
837
+ SourceLoc getLoc () const override ;
836
838
};
837
839
838
840
// / Diagnose mismatches relating to tuple destructuring.
@@ -1441,7 +1443,7 @@ class InvalidMemberRefInKeyPath : public FailureDiagnostic {
1441
1443
1442
1444
protected:
1443
1445
// / Compute location of the failure for diagnostic.
1444
- SourceLoc getLoc () const ;
1446
+ SourceLoc getLoc () const override ;
1445
1447
1446
1448
bool isForKeyPathDynamicMemberLookup () const {
1447
1449
return getLocator ()->isForKeyPathDynamicMemberLookup ();
@@ -1819,8 +1821,6 @@ class ArgumentMismatchFailure : public ContextualFailure {
1819
1821
// / Are currently impossible to fix correctly,
1820
1822
// / so we have to attend to that in diagnostics.
1821
1823
bool diagnoseMisplacedMissingArgument () const ;
1822
-
1823
- SourceLoc getLoc () const { return getAnchor ()->getLoc (); }
1824
1824
};
1825
1825
1826
1826
// / Replace a coercion ('as') with a forced checked cast ('as!').
0 commit comments