This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
Support secondary notes and possible-cause hints for diagnostics #1407
Labels
area: diagnostics
The Q# compiler's error reporting mechanism
enhancement
New request or suggestion for an improvement
In some cases, the cause of an error message may not be localized to the point where the error is generated. It could have multiple causes or related aspects in different parts of the program. It would be helpful if the compiler could direct the user to these parts so they could get more context or consider changing them.
For example:
Here an error message for the expression
[2]
is generated, saying that it doesn't support arithmetic operators. This is correct, but the cause of this requirement is the use of the*
operator in the lambda.Unfortunately, the compiler isn't capable of generating a diagnostic inside the previous statement, because the diagnostic range must be relative to the current statement. This limitation would need to be removed to support this.
The text was updated successfully, but these errors were encountered: