Commit Graph

15 Commits

Author SHA1 Message Date
Konstantin Shcheglov 4c6f5f7658 Remove NullSafetyUnderstandingFlag.
Bug: https://github.com/dart-lang/sdk/issues/40531

Change-Id: I197cfdf64c697a09bb9e0e3896f3ee5ac1967757
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168160
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-02 18:03:24 +00:00
Konstantin Shcheglov 9f986d2501 Migrate package:analyzer to null safety.
Change-Id: Iffe4370431587e46a141ddc72a86ceec29c163b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176486
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-02-01 18:56:04 +00:00
Sam Rawlins c68fd58513 Use ///-style doc comments in analyzer/test
Bug: https://github.com/dart-lang/sdk/issues/33892
Change-Id: If61e07fda4d74b1e5171d22403b156855cd00596
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152701
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-26 18:45:05 +00:00
Johnni Winther dc97454b63 [analyzer,cfe,dart2js] Add pretty printing to id testing
Adds support for pretty printing verbose annotations.
Adds support for force updating annotation texts useful for applying
the pretty printing to valid annotations.

Change-Id: I8fe9b6d2f8198bd5e160854053c8d964ef832a8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129710
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-14 13:24:09 +00:00
Johnni Winther 5829fc7829 [analyzer,cfe,dart2js] Add marker.options files to automate running id tests on all configurations
Change-Id: Ib5eb7f3967634721047f8dcc57b9e6c350b91a41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136226
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-21 08:34:26 +00:00
Konstantin Shcheglov 6f6797e745 Add NullSafetyUnderstandingFlag, update APIs to use it.
DartType.== implementations ignore nullability if the flag is not true.

TypeSystem APIs eliminate nullability from types before doing anything.

Internally analyzer continues using actual nullability for types.

Package nnbd_migration opted into NullSafetyUnderstandingFlag.

Bug: https://github.com/dart-lang/sdk/issues/40500
Change-Id: Ifeea28c01adf1dc59ed2da675b4a62c6334d529a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134865
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-07 21:38:06 +00:00
Johnni Winther e3a20bf361 [analyzer,cfe,dart2js] Support annotated code generation
Add support for generating annotations from actual data using
option -g

Change-Id: I88d9cdb62a38d579234b15097c9e9bb3d81ebe8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129708
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-01-03 13:57:39 +00:00
Konstantin Shcheglov 364dd8936b Fix unnecessary_new in analyzer.
R=brianwilkerson@google.com

Change-Id: I70f80baa3da4b14c0a52c1f28da16a9ad26d7dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127424
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 01:11:30 +00:00
Paul Berry c4b6df5009 Move ID testing infrastructure into _fe_analyzer_shared.
Change-Id: I9f2692dbe750f3c31f8c86e86fe732f34e166517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123860
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-11-01 12:39:00 +00:00
Paul Berry a0ee662b7b Move shared analyzer/FE integration test data into shared package.
This moves the five test suites for flow analysis along with the
constants test suite.

Note that a few files have formatting errors.  I'll fix those in a
follow-up CL.

Change-Id: Ie9bba74c7d91e49ac6c9d3c64a96be007b6a94c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123680
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-31 15:02:03 +00:00
Paul Berry 12532e327f Analyzer ID test fix: annotate methods properly.
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>
2019-10-29 14:58:14 +00:00
Paul Berry b700114b1c Flow analysis: clarify the names of testing data structures.
These data structures are only used for testing (and are not even
created in normal production use).  Add "ForTesting" to their names so
that we are less likely to use them by accident.

Change-Id: Ic719d66089a692362957e257c9bbb2f632bfd174
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122980
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-10-25 09:42:24 +00:00
Paul Berry 5837c65b6e Flow analysis: test unreachability for constructor initializers.
This was already working, it just needed some updates to the test
infrastructure so we could test it properly.

Change-Id: Ie838fb50cf90aabd19c6e0c637df546ddcda16d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122584
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-23 15:50:10 +00:00
Paul Berry 06a8577de2 Flow analysis: recursively annotate unreachable nodes in test
Previously, in the flow analysis reachability tests, we only annotated
a node as unreachable if it wasn't "covered" by a parent node that was
already marked as unreachable.  This made the tests more compact, but
it meant that the testing was less complete, because it meant that we
weren't verifying that the nodes inside of unreachable nodes were also
unreachable.

This CL changes the tests so that we mark every unreachable node as
unreachable, with one small exception: for an expression statement, we
don't mark the expression; we just mark the statement as unreachable,
and we have an assertion in the data extractor to verify that the
expression's reachability matches that of the statement.

Change-Id: I92454c72e9704b34e2dbafb9f5f19a8ee31f8f15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122583
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-23 15:50:10 +00:00
Paul Berry 2cac8637d6 Flow analysis: separate nullability and reachability tests.
Change-Id: I875493ff504f094ade2818f29539525fdd75a808
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112020
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-08-05 22:12:26 +00:00