Commit Graph

8489 Commits

Author SHA1 Message Date
Konstantin Shcheglov 47023e0cc4 Remove unused createDartSdkManager().
R=brianwilkerson@google.com, pquitslund@google.com

Change-Id: If0e1b2753fe94d02fe353495cf5d5e7cc43d3617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174226
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-28 05:12:53 +00:00
Konstantin Shcheglov fe3dd43995 Fix for import directive in part while checking for IMPORT_OF_LEGACY_LIBRARY_INTO_NULL_SAFE.
Bug: https://github.com/dart-lang/sdk/issues/44280
Change-Id: I6a8ef25deaedc55ef33e83ba7614f23fd56fe788
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-27 21:29:05 +00:00
Brian Wilkerson 6905e30446 Improve the message for missing_default_value_for_parameter
Change-Id: I7bc453853716c24a4e1b6cacd44202656dabd743
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-11-27 21:21:45 +00:00
Konstantin Shcheglov b16e402fb9 Prepare for replacing PackageBundle with PackageBundleReader.
There are clients in google3 that import package:analyzer/src/summary/idl.dart
to use PackageBundle. We cannot make changes to idl.dart, so this
CL introduces a new file that we can change, and in the binary format CL
we will replace the exported PackageBundle class with a new class for
the binary format.

Change-Id: Iee89c784a2812bcdeefaef1c122ac8d8533665fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-26 05:13:44 +00:00
Sam Rawlins 4a206e4108 Analyzer: Report invalid instance access from closure within factory
Fixes https://github.com/dart-lang/sdk/issues/43610

Change-Id: Ie9728d375d01ff8c02831befd5fe04b9f5596e35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174020
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-25 23:53:08 +00:00
Paul Berry e047dd60d6 Ensure that function elements inside local variable elements have unique locations.
Fixes #44216.

Bug: https://github.com/dart-lang/sdk/issues/44216
Change-Id: I5ccf8bb5f90396eabfec470a289a193d2aef16ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173881
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-25 13:39:04 +00:00
Brian Wilkerson c6126c34e9 Suggest previously missed type parameters
Change-Id: I09361984b7a58a281769e5feb04aeb1656620237
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173880
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2020-11-25 00:13:49 +00:00
Sam Rawlins e33307fd41 Analyzer: account for parentheses when examining enum switch cases
Change-Id: I1752140bf4f96b45fedf787c3805a8464b6b0720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-23 16:02:48 +00:00
Keerti Parthasarathy 416c06f19b Add a method to clear all artifacts in FileResolver
Change-Id: I420e1de8f873d350e3d90e23536eaa10770d25f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173280
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2020-11-23 07:15:45 +00:00
Sam Rawlins ef39baee37 Analyzer: Don't report all optional parameters on private ctors as unused
Fixes https://github.com/dart-lang/sdk/issues/44268

Change-Id: Ie0f3b004de2761145b7f8acffc3aa82b59a0aea2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-21 22:08:43 +00:00
Sam Rawlins 19a96e4d5e Analyzer: override element type in ExportDirective and ImportDirective
This reduces the number of explicit casts needed for null safety.

Change-Id: I8ad0ab9cddbbe81e5fbf66b95ae4ae1cb57efebc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172743
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-20 15:22:46 +00:00
Konstantin Shcheglov 12cb02528b Issue 44248. Don't report MISSING_DEFAULT_VALUE_FOR_PARAMETER for external functions.
Bug: https://github.com/dart-lang/sdk/issues/44248
Change-Id: I31d2b6ea8efdf0ce47533d4288b3dcd41d113a2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172901
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-19 18:28:24 +00:00
Konstantin Shcheglov 590c4c4b30 PackageBuildWorkspace should stop at the first pubspec.yaml found, don't go up.
Change-Id: I1b996b34055d6887816313d333175869f570ada1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-19 08:08:15 +00:00
Keerti Parthasarathy 6b64d52de1 Add a method to remove unused FileState's.
Change-Id: I6e4644b48245c634cc31a6f32b19be68fd72786b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171981
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2020-11-17 04:34:00 +00:00
Konstantin Shcheglov bb6714c051 Issue 44220. Fix for NPE when checking for INVALID_REQUIRED_* for GenericFunctionType.
Bug: https://github.com/dart-lang/sdk/issues/44220
Change-Id: I7a88a8b34fbda140ab12e6861c0b00a5e5c420b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172360
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-16 22:06:40 +00:00
Brian Wilkerson c88f99b0b7 Initial support for code completion in yaml files
Change-Id: I21276fe32d1c0d8525980edf3b1a5e93de5ae572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172024
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2020-11-16 16:26:36 +00:00
Sam Rawlins 6f77ac032b Remove use of deprecated package_config libraries.
Fixes https://github.com/dart-lang/sdk/issues/44116

Change-Id: I6d429fd31955aecefda01dab55dace922e4e46af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171880
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-14 01:11:16 +00:00
Konstantin Shcheglov 861879fad4 Issue 44196. Change ExtensionElement.displayString to the empty string for unnamed extensions.
Bug: https://github.com/dart-lang/sdk/issues/44196
Change-Id: Idcd6b2caa6efa37350a518d229768e9ab3e24599
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-13 21:44:24 +00:00
Erik Ernst f3ffe6dac6 [analyzer] Adjust several visitors
This CL adjusts several visitors to visit `type` rather than
`functionType` of `GenericTypeAlias`. This is needed because
`functionType` is now a view on `type`, and the former will be null
in some cases such that the underlying `type` is incorrectly ignored.

Here are the locations not yet modified in this manner:

Visitors:
  ResolvedAstPrinter
  AstBinaryWriter
  BestPracticesVerifier

Non-visitors:
  TypeAliasSelfReferenceFinder._sanitizeGenericTypeAlias, _Finder.genericTypeAlias
  VarianceBuilder._genericTypeAlias
  NamedTypeBuilder._getRawFunctionType,
  LinkedUnitContext.getGeneticTypeAliasFunction
  _File._buildFileDeclarations
  _LibraryBuilder._addGenericTypeAlias

analysis_server, visitors:
  _LocalBestTypeVisitor

analysis_server, non-visitors:
  InlineTypedef.compute
  DartUnitOutlineComputer._newGenericTypeAliasOutline
  Files: completion_metrics (about 3 locations in here).

It would be great if I could get some feedback on these: Which ones
are most urgent? Will we keep any of them unchanged?

Change-Id: Ifd55c19571d84bb7ec004b65c5f1f22f3b22cb5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171586
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-11-13 08:21:15 +00:00
Brian Wilkerson 236399ee5e Fix a typo that caused part of the documentation to be dropped
Change-Id: Ie685e019d6df60ba7d336b550e5c1cc1efbd6f68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171810
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-11-13 00:53:55 +00:00
Devon Carew 2ba123b86e [analysis server] remove the --file-read-mode cli option for the analysis server
Change-Id: I279233cd0b7ec09a7d2fdcd50837552f56f2584d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-11-12 21:42:50 +00:00
Devon Carew e7647f2cf2 Revert "[analysis server] remove the --file-read-mode cli option for the analysis server"
This reverts commit 1caee4d1fd.

Reason for revert: This breaks google3 - we need to update the linter's use of the analyzer API.

Original change's description:
> [analysis server] remove the --file-read-mode cli option for the analysis server
>
> Change-Id: Id07e3655cb4bcfc462ada0db8257e7cf584272f5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171101
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Devon Carew <devoncarew@google.com>

TBR=devoncarew@google.com,scheglov@google.com,brianwilkerson@google.com

Change-Id: I68294ad8b565a94aa098e65276b78e9745eec5a5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171640
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-11-11 20:10:41 +00:00
Devon Carew 1caee4d1fd [analysis server] remove the --file-read-mode cli option for the analysis server
Change-Id: Id07e3655cb4bcfc462ada0db8257e7cf584272f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-11-11 19:30:23 +00:00
Sam Rawlins da92120968 Remove usage of Parser statics
Change-Id: I0bf517f77c09adbc97eac597f381428e4f1bd118
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171623
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-11 18:01:12 +00:00
Sam Rawlins dc48399320 Analyzer: Introduce explicit casts required by null safety, in generated/
Change-Id: I7c7ad0abd906caf47fe9900b09b23e24b53cd4f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171441
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-11 17:33:53 +00:00
Nate Bosch 7ddbd262d0 Pass URI to sourceUrl in package:yaml
An upcoming breaking change will change the static type from `dynamic`,
and at runtime allowing either `String` or `Uri`, to having a static
type of `Uri`.

https://github.com/dart-lang/yaml/issues/97

Change-Id: I0abd4c99c0cb2ff3fa220ffd5e30cc5cb683516c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171440
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2020-11-11 16:01:52 +00:00
Erik Ernst 9045077b35 Add ast support for non-function type aliases
Change-Id: I5883ce6e80d451b52073f3770fbdf971e7dcf18c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170692
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-11 07:59:18 +00:00
Konstantin Shcheglov a0227f5902 Issue 44063. Report IMPORT_OF_LEGACY_LIBRARY_INTO_NULL_SAFE hint.
Bug: https://github.com/dart-lang/sdk/issues/44063
Change-Id: I69c6f84da9a9c928e177507cedb30e06a561f3f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-09 19:42:08 +00:00
Sam Rawlins 1b060fb77b Analyzer: prep for null safety with explicit casts, late hints
* `reference.hasElementFor` implies that `reference.element` is not null.
* Using `whereType` prevents an explicit cast from being needed.

Change-Id: I800f7183292ecd0bb6370a381b1d0b924b7f5a61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170744
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-06 22:07:43 +00:00
Sam Rawlins 60323ebce9 Analyzer: Add nullability hints to memory_file_system
The migration tool thinks the various parameters are nullable otherwise.

Change-Id: Ie24cf73bfd32ed4d4bade36a9d4fda76e1ca991a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170481
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-05 11:41:44 +00:00
Paul Berry a44fe3f778 Migration: set SDK min constraint appropriately.
As discussed in
https://github.com/dart-lang/sdk/issues/44031#issuecomment-720967259,
we want to encourage users to publish null safe packages with an SDK
min constraint matching the SDK version that was used for the
migration, e.g. `2.12.0-18.0.beta`.  However, we also want to make
sure that users doing migration via internal, dev, or bleeding edge
builds publish their null safe packages don't wind up inadvertently
publishing packages that are un-resolvable with the latest beta SDK,
so if the user is on one of those versions, we'll set their SDK min
constraint to `2.12.0-0`.

And of course, once the feature ships to stable, we'll want users to
publish their null safe packages with an SDK min constraint matching
the version in which null safety shipped to stable.

This CL implements all of that functionality, and tests it by
overriding the `version` file in the analyzer's mock SDK.

Change-Id: Ib9ed97e691271da0ed391a6c1a5fe209aa959dce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-04 18:26:57 +00:00
Brian Wilkerson b499c76516 Add documentation for some additional diagnostics
Change-Id: Ideb16c6a4c20ebb8e474e8beae841d7bd15afe13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170362
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 17:58:32 +00:00
Konstantin Shcheglov 1726476120 Check for '!' operator when report HintCode.NULL_CHECK_ALWAYS_FAILS
Follow up for:
https://dart-review.googlesource.com/c/sdk/+/170122

Change-Id: If9b3cb1a18ecd7cf21149dbd0fda4ec209506b90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-04 03:43:25 +00:00
Jia Hao Goh 8c91d919b7 Treat integration_test/ as a directory for tests
This allows `invalid_use_of_visible_for_testing_member` to work with `@visibleForTesting` annotations when such symbols are accessed from an `integration_test/` package directory.

Bug: https://github.com/dart-lang/sdk/issues/43921
Change-Id: I530b88459060dbb05eb18d2a6de2902c88c246af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169180
Auto-Submit: Jia Hao Goh <jiahaog@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 00:26:15 +00:00
Paul Berry 92587baee5 Migration: fix "whereOrNull" transformation to handle complex targets.
Previously, when analyzing a call to an iterable method that could
potentially be transformed into an `OrNull` extension, such as:

  allMatches(str).firstWhere(..., orElse: () => null);

the migration tool would erroneously identify some subexpressions of
the call target (`str` in this example) as the argument supplied to
`orElse`, resulting in a crash.

This CL fixes the logic so that we use an `identical` check to verify
when we are looking at the argument to `orElse`.

Fixes #43956.

Bug: https://github.com/dart-lang/sdk/issues/43956
Change-Id: I2f4a0e81becf789cab5334d4926e014bda2772f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170162
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-03 22:48:17 +00:00
Konstantin Shcheglov c0c453f7f1 Issue 44029. Use the function type itself as the type of '.call'.
Presubmit in google3 looks green.
https://test.corp.google.com/ui#id=OCL:340480353:BASE:340480464:1604433051239:7c3180b

Bug: https://github.com/dart-lang/sdk/issues/44029
Change-Id: Ifc02615aa92da7ae0369ef55657cf6b0e9cdb0bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170200
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-03 19:59:07 +00:00
Sam Rawlins c6e4d6bcc8 Analyzer: new Hint: NULL_CHECK_ALWAYS_FAILS
This Hint reports when an expression of type Null is null-checked with `!`.
This check will always fail at runtime.

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

Change-Id: I6e2eac4f7b7720a6b9a1c02066470eb039aa9010
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170122
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-11-03 17:20:14 +00:00
Konstantin Shcheglov 5ac23a0c51 Use ExperimentStatus.currentVersion in MockSdk.
Change-Id: I9750278b58656d9049f689d4e1ea9b9c1f00f863
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170025
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-11-02 17:21:59 +00:00
Brian Wilkerson 2ab3ebad9d Remove a duplicated error code
The parser produces this diagnostic, so analyzer doesn't need to.

Change-Id: I39e2ade681e5580b6ca5493a334d87d66f51e1ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170041
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-11-02 05:06:02 +00:00
Brian Wilkerson 98ba51c48e Improve the highlight range for ambiguous_export
Change-Id: I0c4f887ad467fa5e186ad34650816f15956f623f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170021
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-11-01 15:25:11 +00:00
Brian Wilkerson 3fe3a0384f Improve the highlight range for invalid_super_invocation
Change-Id: I8be664802f04def78304b7cc0e8481d734d295e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170040
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-11-01 15:24:51 +00:00
Konstantin Shcheglov 77f2019f00 Use the current SDK language version by default.
Change-Id: I317ad3858b0f023cdf2fd02a1a28a9c22742b74c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169960
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-31 00:20:22 +00:00
Konstantin Shcheglov 7dcb9bba3e Use the releaseVersion in errors for ExperimentalFeatures.non_nullable
Change-Id: I46a623601aee90f19ce1770cda3c8125ec2ef941
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169943
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-30 23:39:12 +00:00
Brian Wilkerson 195820ec10 Update the message for sdk_version_never and comment in previously reviewed docs
Change-Id: I505e4a577feecbb4deb25eaaeb863a80c7e71602
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-10-30 23:17:12 +00:00
Brian Wilkerson 740857152a Fix the wording of a warning
Because this is only a warning the user can ignore it and the code will
compile and run without problem. Hence, the previous wording was a bit
strong.

Bug: https://github.com/dart-lang/sdk/issues/43189
Change-Id: Ibe4f048191b28230fede8e7e5d76943c5b56f31b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169962
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-10-30 22:57:32 +00:00
Konstantin Shcheglov 77a5f85dbf Simplify check for parameters DeprecatedMemberUseVerifier.
Follow up for https://dart-review.googlesource.com/c/sdk/+/169903

I believe inDeclarationContext() is unrelated and not necessary.

Using thisOrAncestorOfType() is cumbersome here, so I changed it
to iterating directily over parents.

Bug: https://github.com/dart-lang/sdk/issues/44004
Change-Id: I2ecd1d5833b4deaac8afcc8ac9a6a53c3eeb6f4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-30 20:32:32 +00:00
Sam Rawlins d0db3b1d23 Do not report @deprecated field formal parameters at their declaration.
Fixes https://github.com/dart-lang/sdk/issues/44004

Additionally, fix @deprecated parameters referenced in initializers.

Change-Id: Ibad9c3acaf3991c722bee95ecd58d3e3a04bb4cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169903
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-10-30 19:10:03 +00:00
Konstantin Shcheglov 5d383959ce Fix crash when integerDivide and the result is not finite.
There are crashes logged internally.

Change-Id: I8e5705017f976891981389135b4713a13f824f46
Bug: https://github.com/dart-lang/sdk/issues/43997
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169861
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-30 16:08:40 +00:00
Konstantin Shcheglov 2d4a3bd913 Fix UNUSED_ELEMENT for top-level getter/setter.
Change-Id: I4bba8f0d64176e8b96ce273a6679274665b901e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169789
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-30 06:27:50 +00:00
Leaf Petersen a6faf8f2f9 [Language] Enable null safety in Dart 2.12.
Closes https://github.com/dart-lang/sdk/issues/22

Change-Id: I662dd17fda0ff62a871314896fbf1dbe220f41de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166790
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2020-10-29 18:25:56 +00:00