-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-CompilersBugConcept-Diagnostic ClarityThe issues deals with the ease of understanding of errors and warnings.The issues deals with the ease of understanding of errors and warnings.help wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Description
Source:
using System;
class C {
C() {
try {
Action a = () => {
try {
try {
} catch (ArgumentException ex) {
if (1 2)
ex.ParamName.ToString();
}
} catch (AggregateException ex) { }
};
} catch (Exception ex) { }
}
}(all three catch blocks are required to reproduce the bug)
The invalid if causes brace matching to drop out of sync; the } following the ToString() matches the outermost try {, and the remaining catch blocks become class & namespace-level scoping.
This breaks brace highlighting and Ctrl+}, and gives very strange semantic errors (ex.ParamName fails because the field AggregateException ex has no such member).
Metadata
Metadata
Assignees
Labels
Area-CompilersBugConcept-Diagnostic ClarityThe issues deals with the ease of understanding of errors and warnings.The issues deals with the ease of understanding of errors and warnings.help wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it