Analyzer should provide execution details if evaluation of a constant throws an exception #36526
Labels
analyzer-constants
legacy-area-analyzer
Use area-devexp instead.
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
Consider the following code, adapted from the repro for #36511:
Analyzing this code produces the following error message at line (1):
Although this is technically correct, it's far too little information to allow the user to figure out where the problem is. In particular, there's absolutely no information to lead the user to the site of the assertion failure at (2), or to aid in understanding how (2) was reached from (1). This would be even more of a problem if the definitions of classes A and B were more distant, or if the constant evaluation were more complex.
By contrast, the VM's error message contains a full stack trace, and it points both to locations (1) and (2):
We really should improve the analyzer's error reporting here.
The text was updated successfully, but these errors were encountered: