You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Secondary spans on more diagnostics: the declaration a call resolved to, the declared return type #719
Follow-up to #657, whose snippets landed in #714 and whose highlighting is #717.
A diagnostic can carry secondary spans (Diagnostic::labels, underlined with - and labelled), but only one diagnostic uses them so far: the binding whose value disagrees with its annotation (KEXET-0001). #657 also asked for them where a message names another place in the source, for example:
an argument of the wrong type (KEXET-0491): the declaration of the function the call resolved to;
a body that answers the wrong type (KEXET-0127): the declared return type;
a non-exhaustive match (KEXET-0107): the type's declaration, listing the missing constructors.
Each needs the checker to keep that location where it reports the error, then a labelLast(...) call (src/semantic/typechecker.cxx). The LSP could pass the same spans on as relatedInformation.
Activity