Commit Graph

4764 Commits

Author SHA1 Message Date
Konstantin Shcheglov 8c4d10d9cf Tests for IMPLEMENTS_SUPER_CLASS and MIXINS_SUPER_CLASS via type alias.
Also a small tweak for reporting repeated implements/with.

Bug: https://github.com/dart-lang/sdk/issues/45489
Bug: https://github.com/dart-lang/sdk/issues/45526
Change-Id: I6b3e7cb545ce5c63b8facd8b2e55593a45196779
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 21:42:31 +00:00
Paul Berry 20acfbc876 Move checkIndexExpressionIndex checking to resolver.
In order to implement "why not promoted" functionality index
expressions, we need to call checkIndexExpressionIndex from the
resolver, so that we can pass it failed promotion information.  So
move it into the ErrorDetectionHelpers mixin.

Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: Idc70e3421142da1d3100c288c912b6483a91b28c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193087
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 18:24:11 +00:00
Konstantin Shcheglov fa243e700a Issue 45492. Report TYPE_ARGUMENT_NOT_MATCHING_BOUNDS for not regular bounded type as a type alias body.
Bug: https://github.com/dart-lang/sdk/issues/45492
Change-Id: I303a7066c356e645d549960f66c1d7b8d50f307a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193452
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 16:50:11 +00:00
Konstantin Shcheglov fcb9bfb81b Report IMPLEMENTS_REPEATED and ON_REPEATED also when via type alias.
Change-Id: Ied864fe708b6f00976e0629f8f3e514b693b5129
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193451
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 16:50:02 +00:00
Daco Harkes 4ba4fd3f1d [analyzer/ffi] Inline array annotation const dimensions
Moves the Array forwarding constructors and _ArraySize class out of
the patch files so that the analyzer can reason about them.
(The analyzer does not include patch files, because it does not know
whether it's analyzing for VM or JS backend.)

Closes: https://github.com/dart-lang/sdk/issues/45507

Change-Id: Ia0eb4bbca40b906a1e636714f53c5c73dcfc3cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193403
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-03-30 00:28:57 +00:00
Daco Harkes 86635c76fa [analyzer/ffi] Fix NPE in ffi_verifier
Closes: https://github.com/dart-lang/sdk/issues/45498

Change-Id: I836c52b03800bc8282e5f26168f1feab93068b8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193304
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-29 15:56:18 +00:00
Konstantin Shcheglov 5621c9f767 Check for TYPE_ARGUMENT_NOT_MATCHING_BOUNDS when generic_metadata is enabled.
Change-Id: I32b4963f46c232a0ab41fb1b55ffe1c8723a34e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193160
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-27 23:56:46 +00:00
Konstantin Shcheglov 2c02737d7a Support for bounds of generic function types for raw-depends / not simply bounded.
Change-Id: I568f4ebb922b3ce40debff1f4ce20a9ac580f29d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193141
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-27 21:08:06 +00:00
Konstantin Shcheglov 92130a010e Tests for DAS services and generic annotations.
Change-Id: I063c78ae778366e60bb0d4aca55c4e7fd70f3d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193091
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-25 23:38:24 +00:00
Konstantin Shcheglov 4af81e2a5b Issue 45459. Report EXPERIMENT_NOT_ENABLED instead of INVALID_GENERIC_FUNCTION_TYPE when nonfunction_type_aliases is not enabled.
Bug: https://github.com/dart-lang/sdk/issues/45459
Change-Id: I0773f15e4697620427f4449622a592e40b5a5de4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-25 21:43:04 +00:00
Konstantin Shcheglov 97daca81be Report an error when a type alias that expands to a type variable is used where a class is expected in hierarchy.
https://dart-review.googlesource.com/c/sdk/+/192743

Bug: https://github.com/dart-lang/sdk/issues/45450

Change-Id: I5d32236ddff7403eb739ca8b7de421f7f5a36ab6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193001
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-25 18:49:34 +00:00
Sam Rawlins c557efc6bf analyzer: Allow lint rules to be ignored with cannot-ignore
Change-Id: Ib86d4f58595a564c02c804fefd4d5ab05bd35a2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-24 20:42:32 +00:00
Sam Rawlins 97cd131c9a analyzer: Introduce cannot-ignore analysis option.
Fixes https://github.com/dart-lang/sdk/issues/45404, which describes the option
in detail.

This removes all unfortunate exceptions for dart2js test code and for flutter
code. This removes the lateness of one final field.

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

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

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

Related to https://github.com/flutter/flutter/issues/52899

Change-Id: I054f487fafe2742ae57da1d2ccd2d52dce4188bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192560
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-24 13:32:49 +00:00
Konstantin Shcheglov 6b7398227f Fix unlinked API signature for adding '=<nothing>;'.
Change-Id: Idfab6f4e977170c03f0e75476e3524c9312b01ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192860
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-03-24 04:08:47 +00:00
Konstantin Shcheglov df59fd9a3e Issue 45127. Fix for metadata on enum constants.
Bug: https://github.com/dart-lang/sdk/issues/45127
Change-Id: I8e98bc5fd0ba1e04cd88c3a175a08f67034ebb82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-24 01:10:51 +00:00
Sam Rawlins d693078bbf Analyzer: new diagnostic: UNNECESSARY_QUESTION_MARK
`null` is already a valid value of `dynamic` and `Null`, so adding a question
mark to make `dynamic?` or `Null?` is unnecessary, and could lead to confusion.

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

Change-Id: I710ff12935767dd635edfdb026033aa8e27e7804
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190041
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-23 19:55:11 +00:00
Sam Rawlins 07bb38c8c6 analyzer: Report INVALID_SECTION_FORMAT in 4 more places
* Invalid section (not a Map) under `analyzer: errors:`
* Invalid value (not a Scalar) under `analyzer: errors:`
* Invalid section (not a Map) under `analyzer: strong-mode:`
* Invalid section (not a Map) under `analyzer: optional-checks:`

Change-Id: Iad0b33d312f65af8a995677fe4e57389fea520c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-23 15:20:47 +00:00
Konstantin Shcheglov 0c4fdb9ca4 Fix two Windows bot failures.
TBR

Change-Id: I3cda819e1deb953e0d899430f4e363541c4fef15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192660
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-23 04:24:55 +00:00
Sam Rawlins e890c2ab91 analyzer: Add failing test case for deferred element in annotation argument
Bug: https://github.com/dart-lang/sdk/issues/45418
Change-Id: I6332caab0ecc5604d0631f4669314355f699b720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192485
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-22 20:49:52 +00:00
Konstantin Shcheglov 90a5a21267 Issue 45411. Remove hasNoSuchMethod check, already done in inheritance manager.
Bug: https://github.com/dart-lang/sdk/issues/45411
Change-Id: I0eda15a0d51164c897a1a6c555b1b1f127fb887e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-22 20:49:45 +00:00
Sam Rawlins d382ad0896 analyzer: Add new test for deferred type argument in annotation
Change-Id: Ibf29aec03ee912657142bba574309e0e9eeaedd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192486
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-22 20:41:50 +00:00
Sam Rawlins f578bafad7 analyzer: add generic-metadata test case to argument_type_not_assignable tests
Also refactor these tests, in order to get the right experiment. Factor out
common test cases into a mixin, leave two test classes, one of which opts out
of null safety.

Existing tests are left alone except that two which were failing are no longer
failing (simple change in span or diagnostic code).

Change-Id: I2b0dfb4c1df38c6fbd76e5490bbbbd41653edc1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192502
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-22 20:41:40 +00:00
Konstantin Shcheglov 55b21adf6b Break raw type cycles via GenericFunctionType.
Change-Id: Ia1eb5660bf3085a52f3a449da5a3f88ecb81f0af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-20 23:59:09 +00:00
Konstantin Shcheglov 9fc9088fef Issue 44926. Fix checking generic function type arguments for conforming bounds.
Bug: https://github.com/dart-lang/sdk/issues/44926
Change-Id: I92209fc4839c7d286f5efc5d9deb05e47e6cf017
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-20 19:39:09 +00:00
Konstantin Shcheglov 8fd3962363 Fix for accessing CompilationUnitElement.mixins without types.
Bug: b/182750371
Change-Id: I6e15f5f1551b9817eaab503a81597e0d13c77d01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-19 00:27:46 +00:00
Konstantin Shcheglov 2cbb67e5db More tests for resolution and evaluation of metadata.
Change-Id: I4435936d98764650e2f7a278f92e452e3dbfda23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191986
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-18 21:21:43 +00:00
Sam Rawlins ef7a1cb60f analyzer: Allow excludes list which includes some non-Strings
Remove top-level toStringList yaml utility.

Add related TODOs.

Change-Id: I6da4f70ed4f2823c156edd3ae3b803b581e5d9be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191984
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-18 21:12:03 +00:00
Michal Terepeta 9933192f36 Move watching generated Bazel files to an isolate
This does a few optimizations to improve the performance of the analyzer
when watching for generated files:

- We do all the polling in a separate isolate.

- We detect when Bazel finished running and only poll afterwards.

- We use a batch interface and deliver all changes at once (instead of
  one by one). This allows us to avoid resetting caches more often than
  necessary.

I had to remove one of the larger tests and created an integration test
instead, since the code for detecting the Bazel builds relies on
`dart:io` directly (`ResourceProvider` does not expose a way to
check for symlink targets).

Since this required a bit more code, I've decided to create a separate
file for it (`bazel_watcher.dart`).

Change-Id: I6c2383e7fd4348ab8af1af639b10db519c7a2f33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183010
Commit-Queue: Michal Terepeta <michalt@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-18 17:50:58 +00:00
Konstantin Shcheglov 5a313c2595 Support for type arguments and inference in metadata.
Change-Id: Icb019326d73f5d1380c732b36239555a6bcb39d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191483
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-18 17:26:43 +00:00
Konstantin Shcheglov 14327ea035 Handle NON_CONSTANT_MAP_ELEMENT as a const error.
Bug: https://dart-review.googlesource.com/c/sdk/+/191762
Change-Id: I55c52a364079fbf797b285c48bb7eed070c00b9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191803
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-18 06:24:48 +00:00
Daco Harkes 3c55d8bb3e [analyzer/ffi] Support packed Structss
This CL does not add packed structs to `dart:ffi` yet, only to the mock
SDK in the analyzer for testing the analyzer. This means we can review
and land it separately.

Bug: https://github.com/dart-lang/sdk/issues/38158

Split off https://dart-review.googlesource.com/c/sdk/+/186143.

Change-Id: I9c9ac9154e3dec0e05242f57cf7dddf8406df5fb
Cq-Include-Trybots: luci.dart.try:analyzer-analysis-server-linux-try,analyzer-linux-release-try,analyzer-nnbd-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-03-17 22:13:37 +00:00
Sam Rawlins af7d2a4824 analyzer: code quality improvements in task/options.dart
* Add quotedAndCommaSeparatedWithAnd getter to List<String> extension.
  This extension getter allows multiple fields to be initialized in
  ctor initializers.
* Make all ErrorBuilder fields private which enabled analysis that all
  could also be final.
* Refactor ErrorBuilder.code to not be `late final` by using a private
  constructor and a factory constructor.
* Refactor TopLevelOptionValidator _valueProposal and _warningCode to
  not be `late final` by initializing them in ctor initializers.
* Remove the TrueOrFalseValueErrorBuilder class. The class contained
  no useful information and was basically a wrapper around
  `reporter.reportErrorForSpan`. Calling this inline simplifies.
* Change reference in parser.dart as Analysis Server renamed it to
  [_builder] when I refactored one of the fields in options.dart.

Change-Id: Ica867772fca5d3442ab754e588ec07829a822c2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191462
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-17 16:59:14 +00:00
Keerti Parthasarathy 1a7d39b235 Do not compute hints for third party code
Change-Id: I4d9478fb9ebb92a26a98a9711e6fab1c0c39db59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191464
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2021-03-16 23:49:11 +00:00
Sam Rawlins 8bc9d55174 Remove unnecessary experiments in sdk_version_gt_gt_gt_operator_test
Change-Id: Ic49c8f6acc02ef8b1f5660ec12512f4deb8beb25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-16 21:20:03 +00:00
Konstantin Shcheglov c0b800ceb5 Issue 45318. Check for dynamic bounded and Function bounded.
Bug: https://github.com/dart-lang/sdk/issues/45318
Change-Id: I5abd2d237cc3a56551471c2a2fc7a9965eb4223c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-15 22:50:14 +00:00
Konstantin Shcheglov 369c36e67c Issue 45299. Fix yield type check for function expressions.
Bug: https://github.com/dart-lang/sdk/issues/45299
Change-Id: I0f9477a632b635d7e1ac8d4c51f51254e5058cff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191183
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-15 21:26:44 +00:00
Konstantin Shcheglov 60ea845795 Issue 190731. Support for aliasElement/aliasArguments in TypeParameterType.
Bug: https://github.com/dart-lang/sdk/issues/45291
Change-Id: Ia0378722f0e7c48e7a3042c0ef14d6833c7bf2b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190734
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-12 18:22:47 +00:00
Konstantin Shcheglov 45e3d3c77f Issue 45291. Support aliasElement/aliasArguments for interface types.
Bug: https://github.com/dart-lang/sdk/issues/45291
Change-Id: I97bab24f4d7cf3232a0260ec3c6abec6a4c310be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190731
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-12 17:06:17 +00:00
Konstantin Shcheglov dd706e1c0c Issue 45263. Fix resolveToBound() to resolve the promoted bound as well.
Bug: https://github.com/dart-lang/sdk/issues/45263
Change-Id: I285e675bdec931b1987ac97045e6f97e55ad3fd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190730
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-03-12 07:23:49 +00:00
Konstantin Shcheglov 54b2948461 Replace TypeAnnotation.type with null check with 'typeOrThrow'.
Change-Id: I16922aef63d294448436c93004386ee8a3439e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190724
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-11 19:41:10 +00:00
Konstantin Shcheglov 14998dfa5a Fix unlinked API signature for const/static out-of-order.
Saw a crash in logs, was able to reproduce.

Change-Id: I2632c9ec7c3c34e6498f74e17507505128664418
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-11 01:33:21 +00:00
Konstantin Shcheglov a95b7f6313 Remove an unused field.
Change-Id: I18a1f057bb01608b4bfb9584d354d71c50ed7294
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-10 05:16:08 +00:00
Konstantin Shcheglov 7f02c8818e Fix FileResolverTest on Windows.
TBR

Change-Id: I95815a26a46484cd44689b6b47ef62949ad5d1a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190381
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-10 02:19:51 +00:00
Sam Rawlins 0471644ac9 Reland: Report unused system libraries with shadowed elements
Fixes https://github.com/dart-lang/sdk/issues/45028

Change-Id: I77d6ea9f0eaa3589402abf6c23aeae4978694f19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-03-10 00:35:42 +00:00
Konstantin Shcheglov 6550317955 Move updateAnalysisOptions() to CommandLineOptions.
Change-Id: I96e63478f2e3ea65d58a56a1b12dc2726a3d55ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189860
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-03-10 00:34:32 +00:00
Konstantin Shcheglov 97655f06b5 Use null aware invocation in removeUnusedFiles().
Change-Id: I67175e8cdf6ddd678a57a13d32ec55c06b205dfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190302
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-09 23:40:02 +00:00
Konstantin Shcheglov 8d25fccb52 Fix for NPE when checking for OVERRIDE_ON_NON_OVERRIDING_METHOD.
Saw it in crash logs.

Change-Id: I8e4cbfeafa8e3310f89373707e30c8eac6bed544
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-09 23:03:54 +00:00
Konstantin Shcheglov 72e5ac075d Restore linter in analyze tests.
Change-Id: Id96e8669a5242fac4eee0745fd359e50c37fb706
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-09 22:10:22 +00:00
Daco Harkes ffa5d16ae7 [vm/ffi] Support multi-dimensional inline arrays
This CL only changes dart:ffi API, CFE, and analyzer. No VM changes
were needed because the dimensions of inline arrays can be flattened
before passing them to the VM. The multi-dimensionality does not
impact the ABI.

Closes: https://github.com/dart-lang/sdk/issues/45023

TEST=pkg/analyzer/test/src/diagnostics/size_annotation_dimensions_test.dart
TEST=pkg/front_end/testcases/nnbd/ffi_struct_inline_array_multi_dimensional.dart
TEST=tests/ffi/function_structs_by_value_generated_test.dart
TEST=tests/ffi/inline_array_multi_dimensional_test.dart

Change-Id: Ica2c01fccbea7e513879365b34086d8968b54c5b
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188286
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-03-09 10:50:17 +00:00
Konstantin Shcheglov ff14547a20 Make AnalysisSession.getResolvedUnit() and getUnitElement() non-nullable.
Change-Id: I779fe40d1c565f9d4d71ba6a809497d26cae8def
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-09 00:42:23 +00:00