9e690bdd06
Keep track of the most recent same-named fragment even when it has a different declaration kind. This lets augmentation validation distinguish between a missing target and a target whose kind does not match the augmentation. Store this information on elements, serialize it through summaries, and use it during error verification. When an augmentation finds a previous declaration with the same name but a different kind, report `augmentationOfDifferentDeclarationKind` and attach a context message that points to the original declaration instead of falling back to `augmentationWithoutDeclaration`. This improves diagnostics for both top-level and member declarations, including combinations such as constructors vs fields, methods vs accessors, and functions vs variables. Change-Id: Ic794c437fa160bb29d25f90559b544a7282ca697 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494301 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>