35b09df976
When the initializer of a variable declaration is exactly a dot shorthand, we can insert the declared type in front of the dot shorthand to ensure that we're retaining the necessary context type. `E e = .a;` -> `var e = E.a;` In other cases such as typed literals and constructor invocations, the correction already does what we need it to. When we're looking at a for-each and the iterable is a typed literal, if there's a dependent dot shorthand, we add explicit type arguments to the literal to retain the context type. Added tests for the fix and the assist which has the same code path. Bug: https://github.com/dart-lang/sdk/issues/60957, https://github.com/dart-lang/sdk/issues/60994 Change-Id: I31a05f10a7cdaae731c6f6c59deae12c2543a4a6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/441320 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Kallen Tu <kallentu@google.com>