c667238efd
Fixes https://github.com/dart-lang/sdk/issues/61449 The previous code, sure enough, only created a DiagnosticReporter for the defining unit, and only visited the main unit. The fix is to create a DiagnosticListener for each unit, set the DiagnosticReporters correctly and the "current unit" as we go, and then pull the reported diagnostics from each listener. Change-Id: I6b645284c58e5e35ccc5b89f30f6ffe97f48296c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448644 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>