Commit Graph

10502 Commits

Author SHA1 Message Date
Konstantin Shcheglov c2195fcc14 Rewrite to use AnalysisContextCollection in analysis_server.
Change-Id: Iee6b392711790d17c25a3c18fa1e9bdfe8b8cc4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-19 23:01:25 +00:00
Konstantin Shcheglov e4643d5809 Deprecate ElementVisitor.visitFunctionTypeAliasElement()
Change-Id: Ib5d364b77af7974d757626a0719604fa7ec1fec7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185902
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-19 22:21:15 +00:00
Sam Rawlins 09fbc6562e Analyzer: convert two more test classes to use null safety
This was mostly converting star expectations to nullability-suffix-none.

There was a little bit of expected dynamic -> Object conversions,
and expected Null -> void conversions.

Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: Id064a398b8830a60552dfe57d3b5acc89f139eb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185723
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-19 20:43:54 +00:00
Konstantin Shcheglov 29ed048cf2 Fix some null checks.
Change-Id: Id5fa53c60ec1d50e8b9a42dc7e707343031b6f9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-19 19:24:34 +00:00
Dmitry Stefantsov 32fe29617e [cfe] Remove line enabling 'extension-types' flag
TEST=The flag is updated according to the documented recommendations.

Change-Id: I0997b29eafc40844b6ab6dc089ad91723071d4e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185880
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-19 17:43:17 +00:00
Sam Rawlins 02c72dda83 analyzer: migrate dart2_inference_test; move some tests out
All of the tests in dart2_inference_test work fine in null safety,
except a small handful. I moved these into more modern test locations,
and updated the tests to be simpler.

Much much much of the assignment tests were already covered in
assignment_test.dart. I just added a few test cases that did not have
the same coverage.

Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: I144ad4aa7e839c47af0d24c3118ce7bd91eeca7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185724
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-19 17:32:14 +00:00
Konstantin Shcheglov 3bcae5219b Set FieldElementImpl for synthetic getter/setter in top-merge.
Saw it crashing on a co19/ test internally.

Change-Id: I02662ad27eed409df2cadb81502a54207182a104
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185722
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-19 16:37:24 +00:00
Sam Rawlins b0471a2ced Analyzer: rearrange invalid_assignment tests for null safety
I started trying to move checker_tests out from that very old test
class into invalid_assignment, and it was overwhelming. I rolled back
most of the work and kept this part.

Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: Ic41b562cf263b4dae271de2da0f2ec5a716d6dfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185491
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-19 14:32:08 +00:00
Konstantin Shcheglov 9bfd416c45 Add ContextRoot.workspace, deprecated AnalysisContext.workspace, support included excludes in ContextLocatorImpl
Change-Id: Iecd324ad45b926ca6b0626f8bea4f479409154e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185499
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-19 02:15:40 +00:00
Konstantin Shcheglov 9a30392588 Require Workspace for ContextBuilder.getAnalysisOption() and createSourceFactory()
Ideally we want to create Workspace only once, and pass it around.
I was not able to do this yet, because DAS ContextManager kind of
dynamically updates contexts and drivers. I expect to avoid this issue
by switching DAS soon to AnalysisContextCollection.

I will follow with a bigger CL that keeps Workspace in ContextRoot.

Change-Id: I3050ba65400e0e5aa73e6d5f8beae821db10a6ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185498
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-19 00:54:30 +00:00
Konstantin Shcheglov 6c4f354458 Consider 'exclude: foo/**' as excluding the whole directory 'foo/'.
Change-Id: If75fb54929e01481b8511ef83a621a2bdf853c40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-18 19:00:57 +00:00
Sam Rawlins 860aa67a02 Analyzer: convert two test cases to null safety; document two others
Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: I3788f2bb7e7b082a2732a3a77fe59d3547f53f40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185484
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-18 17:20:57 +00:00
Sam Rawlins d2bbb91872 Analyzer: Report on more invlid error handlers.
Bug: https://github.com/dart-lang/sdk/issues/35825
Change-Id: I43060e9b0b0a764f14be041c5cbdf1d884d92326
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181740
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-02-17 15:12:25 +00:00
Dmitry Stefantsov 3a79baed23 [cfe] Add 'extension-types' experimental flag
TEST=The flag is added as per recommended instructions.

Change-Id: I7135fa772e884d083f7388741bc2b3c3a4e6f0e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185360
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-17 14:08:15 +00:00
Daco Harkes 3593de9179 [vm/ffi] Change Pointer.elementAt and sizeOf to use static type
This CL changes the semantics of
`Pointer<T extends NativeType>.elementAt` and
`sizeOf<T extends NativeType>` to use the compile-time `T` rather than
the runtime `T`.

Issue: https://github.com/dart-lang/sdk/issues/38721

TEST=tests/ffi/data_test.dart
TEST=tests/ffi/sizeof_test.dart
TEST=tests/ffi/structs_test.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: Ifb25a4bd66d50a385d3db6dec9213b96dff21722
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,analyzer-nnbd-linux-release-try,front-end-linux-release-x64-try,front-end-nnbd-linux-release-x64-try,benchmark-linux-try,dart-sdk-linux-try,pkg-linux-release-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178200
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-02-17 11:39:42 +00:00
Sam Rawlins 0897b95f3c Analyzer: Support const Symbol('>>>')
Bug: https://github.com/dart-lang/sdk/issues/44908
Change-Id: I7af5587317da43f79f043dd7e92976e1011935ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185242
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-17 08:22:39 +00:00
Sam Rawlins dbe2dee928 analyzer: Add tests ensuring that duplicate operator parameter errors are not raised
Change-Id: Icb9e68164d36010ea6c7b1f83356d592b2bc8416
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185204
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-17 05:24:40 +00:00
Sam Rawlins ff6ddd2972 Analyzer: deduplicate errors when operator defined with bad parameters
If an operator declaration has both too many parameters, and one or more
optional parameters, just report the former error.

This is better UX, and is closer aligned to what the CFE reports.

Change-Id: I1f30ab9564f4bcdc49c1f3317add6c55cca29597
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185201
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-16 22:39:04 +00:00
Paul Berry e0fd546dc3 Improve "why not promoted" context message for the case of writes.
The new message phrasing should flow better, especially in the analyzer CLI.

For the motivation for this change, please see
https://github.com/dart-lang/sdk/issues/44904#issuecomment-776286501

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I595492c64b42aff25cae5a8936c32aa8a218edd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184601
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-02-13 15:21:06 +00:00
Sam Rawlins e05ad3ae9d Migrate NonErrorResolverTest to null safety
In order to do this, I split the test into two:

* many test cases were concerned with type promotion
  which only seemed to pertain to pre-null safe code.
* some code could not be made valid in both null safe
  and pre-null safe environments.

Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: I818a39f2e3eb3cae17de18b008d9e4c7b8ff84c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184844
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-13 03:40:48 +00:00
Sam Rawlins 33910fe2b8 Analyzer: Add wrong-number-of-params error for triple-shift
Also, add more triple-shift tests.

Fixes https://github.com/dart-lang/sdk/issues/42353

Change-Id: Ic14c6fe4f24d955fbdfd1875b21b1881251bd859
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184700
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-12 22:48:40 +00:00
Paul Berry 957c0a1c9d Improve "why not promoted" info for field/property reference.
When reporting that a null check is needed due to a lack of type
promotion, and the thing that was not promoted was a reference to a
field or property, the CFE and analyzer now report "why not promoted"
using a context message that points to the definition of the field or
getter.  (Previously the CFE reported a context message with no
location, and the analyzer didn't report "why not promoted").

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: If1841727b8b60dd87c43f239e6a06b98f363801f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184522
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-02-12 22:43:55 +00:00
Sam Rawlins 89f563c4d3 analyzer: add triple-shift experiment to all tests
Change-Id: I560f82b239d78b748f6e2298a291d71cd2c831a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184840
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-12 21:17:54 +00:00
Konstantin Shcheglov 51950ab881 Add Resource.parent2 that returns non-null Folder, add Folder.isRoot
A bigger version of than https://dart-review.googlesource.com/c/sdk/+/184381
This is breaking change, so we do this in steps.

Change-Id: I0c7212a073b605ade56657036543c604651810c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184581
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-12 19:09:20 +00:00
Konstantin Shcheglov 5ba061c4e1 Un-experiment null safety APIs.
Change-Id: Ib1d0502458625e5569b057140b9a066cc9c0f0b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184642
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-02-12 18:23:12 +00:00
Konstantin Shcheglov 0a04e2ec0f Either2, update Glob to it.
Change-Id: Iae85869339b0c7a35950408c74be08d52b6b5a4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-12 18:02:05 +00:00
Sam Rawlins 337bba0ee9 Analyzer: add triple-shift constant test
Bug: https://github.com/dart-lang/sdk/issues/44908
Change-Id: If510a9aa36fa028e8f91d3cc9dd161282d2db383
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-12 17:45:36 +00:00
Konstantin Shcheglov f6a6e57689 Issue 44223. Improve diagnostics for type arguments violating type parameter bounds.
Bug: https://github.com/dart-lang/sdk/issues/44223
Change-Id: Ia3ffddbc7d2a1be8455f642c5799d21051eefb1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184524
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-12 17:37:53 +00:00
Sam Rawlins 896d72a841 Analyzer: introduce more non-function typedef test cases
Bug: https://github.com/dart-lang/sdk/issues/44078
Change-Id: I9b4f299c61034301b5a9c403f128a614384236ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-12 17:37:33 +00:00
Konstantin Shcheglov 875af7c991 Deprecated TypeProvider.futureType2/listType2/etc
Change-Id: Ia994be1e29b4d96b89d714beafcb9256a0cb4de6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184641
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-12 17:26:07 +00:00
Daco Harkes 34e3f571ac Reland "[vm/ffi] Disallow empty Structs"
Closes: https://github.com/dart-lang/sdk/issues/43974

TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: I35e6f5315826a751e5ce017a6a618c2c224c0f84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180189
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-02-12 15:35:29 +00:00
Sam Rawlins 726e6c65a9 Add non-function typedef tests to for_in_* diagnostics
This also standardizes on using otherwise unused elements in an expression
statement so as to avoid UNUSED_ELEMENT results.

Bug: https://github.com/dart-lang/sdk/issues/44078
Change-Id: I660530509c6224f1aca01d3317483583ea9c581a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-12 00:34:39 +00:00
Konstantin Shcheglov 27e707268f Always crawl up in getOptionsFile()
Change-Id: I424cd625f05d9bc10ae0366e0332e96496633062
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 23:24:11 +00:00
Konstantin Shcheglov 8a80001cb9 Fix null checks in generated summary format.
Change-Id: Ie8c0f19c1604a92c07b8be98301d5ee8f89a2ed8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 22:21:57 +00:00
Konstantin Shcheglov 6944a2c1ec Use extensions in FfiVerifier.
Change-Id: Ib9fe8c4c327508e29aaa330054359b75157bb805
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 20:43:37 +00:00
Konstantin Shcheglov c749c0e3a9 ConstructorDeclaration always has a body, at least EmptyFunctionBody.
Change-Id: I5cbc5317256d02cd1422233107ce469e8d8935f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184341
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 18:08:15 +00:00
Konstantin Shcheglov 3d8d4b4c2b FunctionExpression always has a body, at least EmptyFunctionBody.
Change-Id: I0d09df2571436f30a7706e657a98056a021e25e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 18:00:11 +00:00
Konstantin Shcheglov 244964d893 Refactor ContextBuilder.createPackageMap() and createWorkspace() into static methods.
There are places when we need to call createWorkspace(), but we don't
have enough data to create full ContextBuilder, because we don't
know SdkManager.

Change-Id: I12ec5701ecab897bf1c49c478e8487c7ca348a29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184380
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 17:52:53 +00:00
Konstantin Shcheglov bb696cb6c2 Fix null checks in ConstantVerifier.
Here we apply two techniques:
1. Group pieces of data that always available together;
2. Pass implied data explicitly.

Change-Id: I7d78e9783e9a47bb56ec4e2c8782e6e643b9f5eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184321
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 17:52:08 +00:00
Konstantin Shcheglov 0fb52e9f78 Fix some null checks.
Change-Id: Idd3d88d1f7dd6e2250088498734396b98f8c5375
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 17:44:49 +00:00
Konstantin Shcheglov 90e54dee18 InstrumentationLogger in InstrumentationLogAdapter is not null.
Change-Id: Ie4ab159002c74796429e5176cd09abdcd1a90ad7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184382
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 17:44:05 +00:00
Konstantin Shcheglov 1d5555e67a Remove support for variants in summary format.
We don't use it anymore.

Change-Id: I3c1eaa7bb19629275a2839fd53607d5388178a94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 17:36:46 +00:00
Konstantin Shcheglov 0ffaacc8a6 Fix null checks in dependency tracking.
Mostly replacing fields that we implicitly expect to be filled by the
time when the consumer method is invoked, with explicit parameters.
So, we let the type system to prove that they are not null.

Change-Id: I13e2d943f124886bdb37971ec20cbc0893b0ea78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184384
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 17:36:01 +00:00
Konstantin Shcheglov c323f218a7 Fix a few null checks in CodeChecker.
Change-Id: I585ce017319e2b47f76a29180a669806853dbbf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184385
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 17:28:41 +00:00
Konstantin Shcheglov be1c75dcae Fix null checks in DeadCodeVerifier.
Change-Id: I23afbb131d8cbe16ed49ed7ce90dd0a2ca5fbae7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184400
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-11 17:27:57 +00:00
Sam Rawlins 931203b702 Analyzer: Migrate undefined_operator_test test cases to null safety.
Behavior has changed sufficiently for some of these test cases that I split the
test class into two:

* Any tests which concerned null were moved strictly to the pre-null-safety
  class; different diagnostics are reported under null safety.
* Any tests which concerned type promotion and compound assignment were
  duplicated; promotion changed enough that both cases can be tested.

Change-Id: I069e03b2f97539b0824954b00a5c0484265dd0ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184106
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-11 00:27:06 +00:00
Sam Rawlins 1f870bd3cd analyzer: Deduplicate two WithNonFunctionTypedefTest classes
Since non-function typedefs are enabled by default with
PubPackageResolutionTest, these test classes are currently
unnecessarily split.

Bug: https://github.com/dart-lang/sdk/issues/44666
Change-Id: I0ab32931371fb917df11e45250c84528af9b9e2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184206
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-11 00:25:51 +00:00
Sam Rawlins af0120803e analyzer: Remove unnecessary imports
Change-Id: Iea88852d6592e14007e9853aa2d568a772678e1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184282
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-10 21:37:45 +00:00
Konstantin Shcheglov d208be069e Fix most null checks in AstBinaryWriter.
Change-Id: Ie0de6623503bd2474a44f0d98535f6af9273952e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-10 21:00:55 +00:00
Konstantin Shcheglov 4015a920ed Remove a few null checks.
Change-Id: I271f010aadb41aca81c76ec854e8b30a39bc971b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184283
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-02-10 20:39:05 +00:00