[Chapel Merge] 20919 Fix errors being issued twice by dynoRealizeErrors

Branch: refs/heads/main
Revision: 3889377331b8f462763a3cce2bb4f07a78ed4b9a
Author: Anna Rift
Link: [Merge pull request] # 20919 from riftEmber:errors-issued-twice Fix errors being issued twice by dynoRealizeErrors by riftEmber · Pull Request #20919 · chapel-lang/chapel · GitHub
Log Message:

[Merge pull request] # 20919 from riftEmber:errors-issued-twice
Prevent dynoRealizeErrors from issuing duplicate errors
Prevents issuing the same error twice in dynoRealizeErrors. In this particular case, the error was issued twice because: 1. The used module's file is first parsed within the Dyno query system due to being a dependency of the main file, and errors are reported to the DynoErrorHandler from here. 2. The module's file is parsed again because the production compiler identifies it as a dependency of a file named on the command line. This parsing is done via a Dyno query so the memoized result from step 1 is returned, avoiding redundant work. As this is the same parsing result it points to exactly the same errors, but these errors are reported out again at this point. The error reporting in step 1 is necessary for standalone Dyno parsing to be correct, and the error reporting in step 2 is necessary for parsing errors to be caught in all relevant files whether or not they happen to be detected as dependencies by the query system. In summary, due to the division of work between the production compiler and Dyno library, duplicate errors in some situations are not easily avoidable. @DanilaFe and I determined the most elegant solution is to detect them after the fact. This PR implements that at the point where Dyno errors are reported out by the production compiler, simply ignoring identical error pointers. An alternative implementation would be to detect and discard duplicates at the time they are reported, but this would be less clear and marginally less performant. Resolves https://github.com/Cray/chapel-private/issues/3937 Testing: - tests listed in https://github.com/Cray/chapel-private/issues/3937 - primers with --dyno - paratest

Compare: Comparing d31f3e5222bae162e1e4d08391d73e7444e2ed74...3889377331b8f462763a3cce2bb4f07a78ed4b9a · chapel-lang/chapel · GitHub
Diff: https://github.com/chapel-lang/chapel/pull/20919.diff
FilesChanged: Fix errors being issued twice by dynoRealizeErrors by riftEmber · Pull Request #20919 · chapel-lang/chapel · GitHub

Modified Files:
compiler/parser/parser.cpp,test/library/standard/IO/readAll/readBytesArrayInsufficientCapacity.compopts,test/library/standard/IO/readAll/readBytesArrayInsufficientCapacity.good

Removed Files: