Skip to content

Commit 85e6f73

Browse files
committed
[Diagnostics] In MissingConformanceFailure, if the non-conforming type
comes from an argument, use the argument expression as the anchor for `diagnoseTypeCannotConform`.
1 parent ea2acc6 commit 85e6f73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,9 @@ bool MissingConformanceFailure::diagnoseAsError() {
598598
return true;
599599
}
600600

601-
if (diagnoseTypeCannotConform(anchor, nonConformingType, protocolType)) {
601+
if (diagnoseTypeCannotConform((atParameterPos ?
602+
getArgumentAt(Apply, *atParameterPos) : anchor),
603+
nonConformingType, protocolType)) {
602604
return true;
603605
}
604606

0 commit comments

Comments
 (0)