758d3a8803
Converts the code that reports diagnostic codes `invalidAssignment` and `argumentTypeNotAssignable` to use the literate diagnostic reporting API. This was challenging because some of the code for reporting these diagnostics (specifically the method `ErrorDetectionHelpers.checkForAssignableExpressionAtType`) was parameterized by diagnostic code, but the two diagnostics accepted a different number of parameters. To get the type safety of the literate diagnostic API while preserving the existing behavior, I've created an abstract base class, `NonAssignabilityReporter`, with a method `createDiagnostic`, that encapsulates the differences in how to handle the two diagnostic codes. Change-Id: I6a6a69649e53f6980b5033771b14dbfdaa5895d6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467481 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>