Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Scope prints in diagnostics #2777
The proposed change is to add context information in warnings and errors, so that not only source positions are printed, but also item names. For example,
We can already do the following:
but it needs to be done on every error manually. Although this approach requires more effort, it also is more targeted, which means that we only show it when relevant. The devil's in the details, but the implementation of this seems "hard".
@estebank yeah, it's hard. There's also the issue of avoiding redundant scope prints when we have two or more different types of errors in the same scope , which probably means tracking scopes and perform unification of several unrelated errors based on their scope. Perhaps this can be done outside the call sites to emit diagnostics (i.e. only in
On the bright side, simply avoiding duplicates in