This avoids the need to special case test expectations for CFE in
pkg/front_end/test/flow_analysis/reachability/data/never_return_type.dart.
Change-Id: Ib754a76c96e73c8183b5ff10a2e7d2908e653a31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123420
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This should make it easier to verify that the CFE implementation is
correct.
Note that this effort encountered a few bugs in the analyzer
implementation, which are marked with TODOs. I will fix them in
follow-up CLs.
Change-Id: Ic164a1cf214b5730f848b17db2838c29d25b00d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122850
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The data structure isn't optimized (recording data into it takes
O(n^2) time, where n is the number of unreachable nodes in the file),
and we don't need it for normal execution anyhow.
Following the model used by CFE and dart2js, the analysis driver has a
new flag `retainDataForTesting` to control whether the test data is
gathered, so that under normal execution there is no overhead. The
testing data is stored in a new class `TestingData`; we can expand
this class in the future if we need to record other intermediate
analysis results for testing.
Change-Id: I7e79d31b9f3c9c45121dceb49094be802e4d286f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111481
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Add a "-s" (succinct) option to have a more dense output.
Meant for use together with "-a" so one can get a quick overview of how
many tests fail, e.g.
out/ReleaseX64/dart pkg/front_end/test/id_testing/id_testing_test.dart -a -s
Change-Id: I9e1d91694be76e6c66bf0f3c9168783f920a5bf4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110914
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
We still verify that the analyzer passes these tests, but we now do
the verification using the "ID test" mechanism that's shared with the
CFE. This will allow the front end to run these tests as soon as its
integration with flow analysis is complete.
Still to do: migrate tests of type promotion and definite assignment
so that they can be shared by the front end.
Change-Id: I3c2ac6ff8b66e3a27110dcdb1f1d2dece447c18d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL reworks the tests flow_analysis_test.dart and
type_promotion_test.dart to make use of the framework recently
introduced into pkg/front_end/lib/src/testing/id.dart. The long term
goal is to move these tests into a common location so that they can
exercise both the front end and the analyzer.
Change-Id: Iad95065e995b0fe3c6e4990d2ea015215895743a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108265
Reviewed-by: Johnni Winther <johnniwinther@google.com>
The AST refactor for "UI as code" left behind a few things whose names
ended in "2". This CL deprecates those things and creates
replacements that don't end in "2", so that we keep the API clean. In
a future breaking change release of the analyzer we'll remove the
deprecated things.
The following methods and classes are added:
- ForStatement and ForStatementImpl
- ListLiteral.elements
- SetOrMapLiteral.elements
- AstVisitor.visitForStatement
- AstFactory.forStatement
- NodeLintRegistry.addForStatement
The following methods and classes are deprecated:
- ForStatement2 and ForStatement2Impl
- ListLiteral.elements2
- SetOrMapLiteral.elements2
- AstVisitor.visitForStatement2
- AstFactory.forStatement2
- NodeLintRegistry.addForStatement2
In a similar way to how we did the previous stage of AST migration,
the existing visitors have been modified so that the default
implementation of visitForStatement2 redirects to visitForStatement;
this allows clients to change their overrides of visitForStatement2 to
override visitForStatement instead. Once all clients have been
migrated we will be able to delete the visitForStatement2 method.
Change-Id: Ife5949071fe4cb50791cd4f2f4b99a1bfaad54c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97360
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
ba5644b76c fixed an analyzer bug causing
a crash when a top level variable requiring type inference contained a
closure involving type promotion, and removed some explicit types that
were present in the analyzer to work around the bug.
Although the bug has been fixed now, the fix hasn't rolled out in a
release of the SDK. So to avoid people seeing analysis server crashes
when editing the analyzer, I'm re-introducing the workaround.
Change-Id: I5e61345021cd33cb9ad1f017a7619815a38c6a1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95667
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Promotion analysis requires the localVariableInfo data structures to
be set; these are set by the VariableResolverVisitor. So we need to
ensure that this visitor runs prior to type inference.
Change-Id: I579301beb101f32a1965f9eb8f07b1196d232b8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95422
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>