There are no semantic changes in this CL, just renames.
The one unfortunate rename was from `DEFAULT` to `default_`. It can't be
`default` because that's a built-in identifier. If you have a better
convention to follow here I'm happy to change it.
Change-Id: Idf70621ad577dbea6c1c161aac17e9e200aac2d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433440
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
The bullets on this doc were bugging me because they were confusing which tasks were subtasks of one another. I made them all into checklist bullets (since that's what's most useful for me anyways) and it looks much better.
Change-Id: I593ceb7db5ae39ffda52a2a2e481b1c53a5a7784
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
This change introduces some helper functions to avoid duplication
between the enabled/disabled variants of each of the try/finally
ordering tests.
Thanks to Lasse for the suggestion.
Change-Id: I4538d44643fde7954a75bc1b6843fcc805d8afc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432782
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This change adds test-only methods `propertyPromotionChainForTesting`
and `variablePromotionChainForTesting` to flow analysis; these are
used by the flow analysis unit tests to query the full promotion chain
of a porperty (or variable, respectively). This allows tests to
observe the effect of try/finally ordering on promotion chains without
having to resort to clever control flow joins.
Thanks to Lasse for the suggestion.
Change-Id: Ida5349ecc93dbd4b3392becd20882be3eb101024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432800
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The related issue asked for a new priority for the `Create class` fix
that would be lower if the undefined name was lowercase, giving the
`Create method` and `Create function` fixes a higher relative priority.
This change also adds a new abstract class to test the relative priority
between fix kinds. It is also used to test agains the merge combinators
fixes.
Fixes: https://github.com/dart-lang/sdk/issues/60523
Change-Id: I938f52a577ecf1b6bb8dd66c94fd45395a011ffa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/422321
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This disables the assist if the field formal parameter happens to also
be an older style function typed parameter. As written the assist
produces invalid code, and the older style is strongly discouraged so
not supporting it shouldn't impact very many users.
Change-Id: I44a3942b4656265bb1cbbba29e68fff61962b689
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433260
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Work towards https://github.com/dart-lang/sdk/issues/60635
I tried to keep this minimal but still sensible:
* Rename AnalysisErrorListener and all subtypes to use 'Diagnostic'.
* Rename all instantiations of such classes if they previously
contained the word 'error'.
* Rename `RecordingDiagnosticListener.errors` to `.diagnostics`.
* Rename some _testing_ instance members that had the word 'error'
to instead use 'diagnostic'.
Change-Id: I3948e27ba28ac2494092e04f4e1d201a20cc1135
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433004
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Rename DummyInterceptorConstantValue to DummyConstantValue. It was
actually used as a dummy *receiver* argument and could be used against
any unused parameter.
Remove unused CompilerOptions argument in SSA as-checks and is-tests.
Pass the checked input explicitly to facilitate testing on other inputs (e.g. to do partial redundancy elimination by pushing the operation into the arms of a phi.)
Change-Id: I4b450bfcf5fc877de731bf83201e3c9248ffcb0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433104
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Doing load elimination of final fields earlier generates more
opportunities for GVN. This helps when the same value is 'boxed' in a
wrapper object and the 'unboxed' multiple times.
Change-Id: Id3a2b392a7563bae7a4cd1f8b2763c5ac1b377b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/432502
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
This prevents inline values showing up alongside code that didn't execute in conditional blocks. It does also mean they don't know up in conditional blocks that _did_ execute one execution has fallen out of them, but I believe this is the best we can do with the current LSP APIs (unless we try to track execution across requests, but that would probably be complete and not entirely reliable).
Fixes https://github.com/Dart-Code/Dart-Code/issues/5454
Change-Id: Ia1cf2437b76844ff0a6aeeb958d769c9523dc5dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433200
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This is a partial revert of ca9523058e (it removes the behaviour change and the test that verifies this, but leaves two additional tests that were added relating to roots that are created later).
If we rebuild contexts when a root is deleted, we may get stuck in a loop because we will again try to recreate the same (deleted) root, and then the watcher will close in a way that looks like a deleted folder, and we will repeat.
Fixes https://github.com/dart-lang/sdk/issues/60863
Change-Id: I10289160b341d273e8e409184a1c013c7fb9439d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/433140
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
For https://github.com/Dart-Code/Dart-Code/issues/4729 we added a configuration setting to let you control how much documentation was included in responses. The motivation here was to reduce the completion payload sizes when running in remote workspaces (Dart-Code would adjust the default setting if not explicitly set by the user based on the workspace kind).
However in hindsight, forcing no docs on Hovers just because we didn't want them in Completion requests was a bad choice, because these are individual requests where the payload size is less important and seeing the docs is useful.
So this alters the setting to accept a `Map` to allow you to have different preferences for each request that returns docs. Dart-Code will be updated to adjust the defaults accordingly (after this lands) so that Hover/SignatureHelp can default to `"full"` even in remote workspaces.
Work towards https://github.com/Dart-Code/Dart-Code/issues/5499
Change-Id: Ib64f762a0559c7afc7653fad9749fc208beee8b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431280
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
When an `is` test is trivially satisfied (i.e. `expr is T`, when the
static type of `expr` is a subtype of `T`), the `is` test is
guaranteed by soundness to evaluate to `true`, so any code path that
follows from the `is` test evaluating to `false` is unreachable.
This reasoning wasn't valid prior to sound null safety, because in
mixed mode programs, it was possible for an expression to evaluate to
`null` even if its static type wasn't nullable, and hence `expr is T`
might evaluate to `false` even if the static type of `expr` was a
subtype of `T`. So this change is gated on the `sound-flow-analysis`
language flag (which is enabled in Dart 3.9).
Fixes https://github.com/dart-lang/sdk/issues/60718.
Change-Id: I66a65580b738162f23b6fb468b71fcac66bfbb95
Bug: https://github.com/dart-lang/sdk/issues/60718
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431740
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>