Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dyno: emit error for failed implicit 'super' calls (chapel-lang#26630)
Closes Cray/chapel-private#6722, which asks to emit an error when a call to 'super' is implicitly inserted but fails to resolve: ```Chapel class Parent { var x : int = 42; proc init(x: int) { this.x = x; } } class Child : Parent { var y : string; proc init() { // tries to resolve 'super.init()', but parent 'init' requires an argument! this.y = x:string; } } ``` This PR performs a relatively major re-architecture of the way that calls are resolved and noted as part of Dyno's resolver, which reduces the effort (at call sites) to handle the results of these calls. This stemmed from the observation that a variety of resolver functions for call resolution have nearly 10 arguments, and thread through the same state that's passed in when a call is first resolved. For instance, a user might perform `resolveGeneratedCall`, then call `handleResolvedCallPrintCandidates,` which will in turn call `handleResolvedCallWithoutError`, etc. To invoke these helpers, the user would need to re-pass the call info, scope information, a boolean indicating if the call was generated, and much more to these functions. Not only that, but these invocations to `handle*` were not always performed, even though they are instrumental to tracking `compilerError` information and noting PoI scope info. This PR creates wrappers around the various call resolution procedures from `resolution-queries.h` that bundle together the result of resolving the call with the information needed to note it etc., via a new type. This new type exposes methods analogous to `handleResolvedCallPrintCandidates`, except they do not require re-threading through of the 10 arguments that were previously needed. This new type also has some state (in the form of `callName` and `reportFunction`) which can be used to customize the behavior of error reporting. In the case of the new error message added by this PR, the reporting function is used to issue a `NoMatchingSuper` error, which contains additional data and is used for a very detailed explanation of what went wrong. ![Screen Shot 2025-01-30 at 4 50 33 PM](https://github.com/user-attachments/assets/32f60509-00ba-4b15-b2fc-badefe4abb90) Reviewed by @benharsh -- thanks! ## Testing - [x] dyno. tests - [x] paratest
- Loading branch information