Files
sdk/pkg/_fe_analyzer_shared
Paul Berry 10d531b5f9 Flow analysis: Minor fixes to "why not promoted" ID tests.
The ID tests for the "why not promoted" feature had some minor
unintentional errors in them.  This CL fixes them:

- The constructor tests in
  argument_type_not_assignable_nullability_error.dart tried to return
  null from functions whose return type didn't allow it.

- The compoundAssignmentRhs test in
  argument_type_not_assignable_nullability_error.dart tried to add an
  `int` to an `int?`.  The CFE considers this to be an error, but also
  reports a follow-on error because it thinks the type of the
  resulting expression is `num` (which is not assignable back to
  `int`).  To avoid the follow-on error, we use `num` for the type of
  the variable to which compound assignment is being applied.

- The forElementInMap test in
  for_in_loop_type_not_iterable_nullability_error.dart wasn't a proper
  map (it contained two `null` elements, rather than a single map
  entry `null: null`, which was what was intended).

There were also several tests for which we *don't* expect "why not
promoted" information; I added comments explaining why.

Change-Id: I91ddb88cb0f25f9b209df3eeb75d57d8270f877b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193561
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-03-31 15:20:28 +00:00
..

FE/analyzer shared code

This package contains logic that is shared between the front_end and analyzer packages. It is intended solely to facilitate development of the Dart SDK, and is not intended for use by end users. In particular, this package has no public API, so no guarantee is made of compatibility between one version of the package and the next.

End users should consider using the analyzer package to analyze Dart source code.