Commit graph

31314 commits

Author SHA1 Message Date
Konstantin Shcheglov cd360dee2a Non-nullify types during inheritance inference.
Change-Id: I97567a6d77e2afdbc995d7561d87baabaae5abfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151634
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-18 17:14:41 +00:00
Stephen Adams a26ad7fb7c Remove more old-rti code
Change-Id: I9c9cf3d1a408138790176525cff4e8991cd1ba32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151632
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-18 16:24:10 +00:00
Vyacheslav Egorov 73e95f7f49 [vm/tool] Add snapshot_analysis summary command.
This CL also refactors ProgramInfo making it less structured - we remove
individual node types (LibraryInfo/FunctionInfo) and represent
the information using ProgramInfoNode class instead.

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

Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I0156ae75f48a41b7689790860267ac88706d55c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151227
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-18 11:57:13 +00:00
Tess Strickland 7c34a80c11 [vm/aot] Keep column information when possible for precompiled mode.
Previously, we passed line number information to the stack trace printer
and to DWARF by changing the non-special positions in the CodeSourceMap
to line numbers in precompiled mode. However, doing this lost column
information.

We get the column information back in the majority of cases by encoding
the line number and column information when neither is too large to pack
together into 30 bits. (Here, 20 bits for line and 10 bits for column.)
Otherwise, we just store the line information as before, though due to
using a bit to encode whether column info exists, it's reduced to 30
bits. If the line info is too big for that, we just return kNoSourcePos.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try
Change-Id: Id1c826f10871e2f304fa40a59d8b704404d3a2c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151507
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-06-18 10:45:33 +00:00
Daco Harkes 7eac9f355e [vm/ffi] Expose a subset of dart_(native_)api.h for dynamic linking.
This CL introduces dart_api_dl.h which exposes a subset of dart_api.h
and dart_native_api.h for dynamic linking at runtime through the FFI.
Dynamic linking is done through including dart_api_dl.cc in a shared
library and passing NativeApi.initializeApiDLData to the init function.

This CL also includes Native API versioning to deal with possible
version skew between native api version against which native libraries
are compiled and the version in the DartVM the code is run on.

The subset of symbols in the CL includes handle related symbols, error
related symbols, handle scope symbols, and native port sumbols.

Design: http://go/dart-ffi-expose-dart-api

Closes: https://github.com/dart-lang/sdk/issues/40607
Closes: https://github.com/dart-lang/sdk/issues/36858
Closes: https://github.com/dart-lang/sdk/issues/41319
Closes: https://github.com/flutter/flutter/issues/46887
Closes: https://github.com/flutter/flutter/issues/47061

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

Change-Id: I9e557808dbc99b341f23964cbddbb05f26d7a6c5
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-nnbd-linux-debug-x64-try,analyzer-nnbd-linux-release-try,front-end-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145592
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-18 07:30:43 +00:00
Jaime Wren ae6a489dfb New 'non-type member completions' relevance tests in the analysis server.
This test includes: a failing type parameter test, as well as a common completion bug with Flutter widget construction, this test shows that the new relavance logic does the right thing.

When we add additional categories in completion metrics to split apart this group of completions, this test may be split as well, this name seemed appropriate for the time being.

Change-Id: I67638a121528be5e9a20bebc022a576282db1867
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151631
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-06-18 00:03:31 +00:00
Konstantin Shcheglov 60bb0d3a41 Separate current and to restrict FeatureSet(s) in scanner.
Bug: https://buganizer.corp.google.com/issues/159207726
Change-Id: I41b4c79590dccd05d8b0fa42d296f00a3c3ee229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151620
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-17 23:32:31 +00:00
Konstantin Shcheglov 2fe40ad6ed Move ConstantAnalysisErrorListener to linter context.
R=brianwilkerson@google.com

Change-Id: I14774bfaad95c5afb1498462559341fcf5b3b1db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151630
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-17 22:45:51 +00:00
Konstantin Shcheglov 327304cb59 Issue 42356. Report constant errors for arguments in constant instance creations.
Bug: https://github.com/dart-lang/sdk/issues/42356
Change-Id: I674878c12b82af229d70e7a6eca5cd662ec29394
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151623
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-17 21:49:55 +00:00
Paul Berry 717efd357f Migration: do not add ? after the Null type
Fixes #42322.

Change-Id: I4c26985da520e024b8a6c335834dd0fc2a41d59d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151561
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-17 21:29:51 +00:00
Paul Berry 7cd5e1ecbd Sort declarations in fix_builder.dart
Change-Id: I914e6fb43f17d8b2c2f01ec83a13c0bb9ef1e729
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151580
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-17 21:29:51 +00:00
Vyacheslav Egorov 80fed2cfc2 [vm/tool] Move snapshot analysis commands into their own directory.
Issue https://github.com/dart-lang/sdk/issues/41249

Change-Id: I3ce17d2ca2075e551c9e72e09731f99e7e0f9e69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151226
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-06-17 20:57:03 +00:00
Jaime Wren 5944ff823f Context type improvement for code completion, fill in missing functionality and add tests for FieldDeclarations, VariableDeclarations, VariableDeclarationList, and TopLevelVariableDeclarations.
Change-Id: I7267712f68990b5f55ab64bca2345409e41738b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-06-17 20:42:41 +00:00
Stephen Adams 0ccc96f470 [dart2js] remove more old-rti code
Change-Id: I462dd6aec1bf39c16e340699b2803254fd4fc941
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151345
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2020-06-17 20:31:01 +00:00
John Ryan 8fe9dac0c8 add Dart logo to null safety migration tool
Change-Id: Ie9cd580fad0e596f1653e3a87cde75e133d1fe2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151360
Commit-Queue: John Ryan <ryjohn@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-17 20:17:21 +00:00
Danny Tuppeny 7f8ec737db Add a note to docs about enumerations being extended
Change-Id: Ia5d6017018b812777b35641c2ee5a4bca9aa9501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151527
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
2020-06-17 19:32:50 +00:00
Danny Tuppeny 7951b21c91 Add folding regions for do/while loop blocks
Change-Id: I92c5c9392ca6e19e8ca0378beb23100fe0ccd1db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151524
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-17 19:32:50 +00:00
Danny Tuppeny f0e1f32c87 Add support for folding if/else/elseif blocks
Change-Id: I3cbf1f282ee59c577c6ba912e957f838e827fd3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-17 19:32:50 +00:00
Joshua Litt d14ab0779a [dartdevc] Migrate tests/compiler/dartdevc_native to tests/dartdevc_2.
Change-Id: I9c486f29f3bcf8a6ecf481eb25ea61d0468049b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150667
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2020-06-17 18:14:00 +00:00
Paul Berry 82750c58f7 Update toList in analyzer's mock SDK
Fixes #42327.

Change-Id: Iecab55d0c97d439de02ac63ba53a0511532c773f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151560
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-17 17:20:57 +00:00
Kevin Moore 073cbcc5a4 [pkg:js] Enable pedantic lints
Change-Id: Ia03a68431d3e62f2b5db45d3c38fb99f5ab07ca6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151540
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2020-06-17 16:35:56 +00:00
Martin Kustermann 168539d61d Reland "[vm] Build dart2native dependencies with the normal "create_sdk" target"
The flutter engine DEPS got new icu/boringssl so this CL can safely
land and roll into engine. A small change is made in Patchset 1..3.

This removes special logic for creating the `dart-sdk` we distribute
which used to build release and product mode and copied some binaries
from the latter into the former, before the SDK was actuallly ready to
test and distribute.

This changes the GN build rules to build the necessary
gen_snapshot/dart_precompiled_runtime product binaries during the normal
release build.

Normally during --mode=product builds the global build config in
//build/config/BUILDCONFIG.gn will set `-fvisibility=false`.

=> Doing so results in much smaller binaries - because only explicitly
   exported symbols are visible, the rest can be tree shaken by the linker.

Since we are building --mode=release, the `-fvisibility=false` will not
be set. In order to set the flag for the 2 special product-mode binaries
we need to add -fvisibility=hidden manually, in:

  * dart_product_config: Which is used for compiling VM sources.
  * 3rd party double-conversion library
  * 3rd party boringssl library
  * 3rd party icu library

The upstream CLs are:

  * BoringSSL: https://dart-review.googlesource.com/c/boringssl_gen/+/150482
  * ICU: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2236407

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

Change-Id: I8d9b37acbb5eb94e44d97652f838948a946fd372
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151505
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2020-06-17 16:12:26 +00:00
Danny Tuppeny f36151e2d2 Add ChangeTo/CreateClass fixes for implements/mixin of missing identifiers
Change-Id: Iac0c512e87aaf5ba183d155e7bffe2a74936d7a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151509
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-17 15:44:36 +00:00
Brian Wilkerson 094d98a812 Use the context type for available declarations
Change-Id: I698becd01145dde94505608f99171789a7f39c62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151428
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-17 15:43:36 +00:00
Danny Tuppeny b2f755ac07 Add a note about passing client-id/client-version to LSP doc
Change-Id: Ic82e5915e512c78c99b963bbaa74aaed42374726
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151506
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
2020-06-17 15:06:54 +00:00
Danny Tuppeny 728df5d9ab Fix placement of "final" for late fields with types
Fixes https://github.com/Dart-Code/Dart-Code/issues/2553.

Change-Id: Ief79c8d5e095c17afc39d83eb231604bcf224ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151511
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
2020-06-17 14:56:04 +00:00
Sam Rawlins 8fcb9e4b0e Migrator: draw a hard edge when marking an AsExpression non-nullable
Fixes https://github.com/dart-lang/sdk/issues/41397

Change-Id: I03307f297954f97911ed501240df17e48ef2dfc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151480
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-06-17 14:38:24 +00:00
Paul Berry 0b12c1d775 Migration: fix crash when there is an extension in code not being migrated
Change-Id: Ie7d4daf827f7803ea4001a26e06aa58577b9d49a
Bug: https://buganizer.corp.google.com/issues/158730342
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151443
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-17 14:03:44 +00:00
Tess Strickland c45c07592a [vm] Test disassembly in v8_snapshot_profile_writer_test separately.
Disassembling on every run makes it difficult to get an idea of which
specific configuration failed. Instead, just pick a configuration that
already succeeded and test that configuration with disassembly
separately so that it's clear if the disassembly was what caused the
failure.

Also add reasons to Expect.isTrue/isFalse uses in
package:vm/v8_snapshot_profile.dart. Now we don't have to track down the
specific line to find out what failed when reading logs. Another benefit
is that the error message now includes the values involved in the
failure and not just "Expect.isTrue(false)" or "Expect.isFalse(true)".

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try
Change-Id: I3d4b533f4df041dfcced4eaeb8bc5729dfad0b82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151502
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-06-17 11:11:43 +00:00
Jago 7d863d7266 Doc: DateTime accepted format for parsing date
Add to the inline documentation the most simple and often most used simple date format that can be parsed, that was missing.

Closes https://github.com/dart-lang/sdk/pull/42209
https://github.com/dart-lang/sdk/pull/42209

GitOrigin-RevId: 03e6d955961a2fc8b0eab5c9e46f4212ef470c9a
Change-Id: Ia2a5e8376a3741d34dbd27ceb6f39d986687bfee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150507
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-06-17 08:43:23 +00:00
Mike Fairhurst aa3f7dc4e9 [analysis_server] Fix crash reporting bug, casting exception to a string
Brian noticed this running unit tests. Who knows how many bug reports we
have missed from this -- we can only hope it is very few.

```
type '_TypeError' is not a subtype of type 'String'

package:analysis_server/src/server/error_notifier.dart 26:7        ErrorNotifier.logException
package:analysis_server/src/analysis_server.dart 266:54            AnalysisServer.handleRequest.<fn>
dart:async/zone.dart 1222:13                                       _rootRunBinary
dart:async/zone.dart 1107:19                                       _CustomZone.runBinary
dart:async/zone.dart 1601:18                                       runZonedGuarded.<fn>
dart:async/zone.dart 751:19                                        _ZoneDelegate.handleUncaughtError
...
```
Change-Id: Ib83dc99a88a1566ead5d59a9f71afc80416eb341
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151464
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-06-17 07:11:30 +00:00
Konstantin Shcheglov 9468ba063e Non-nullify types when inferring types of top-level variables and fields.
Change-Id: Id272958725d582892aa9cacdddbb5cde89793bf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151444
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-17 05:15:10 +00:00
Stephen Adams 88411f7cf7 Don't run analysis_server_client tests on dart2js
They use 'dart:io'.

Change-Id: Ia18dff5c4427e5592adbe426d2d1afb3b1af9b53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151361
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-17 05:08:40 +00:00
Konstantin Shcheglov d279cb47b5 Enforce sorting in analyzer/.
Change-Id: If7e76e442e64cd4991b80c3993e3da10bb3a19ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151462
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-17 05:04:30 +00:00
Jacob MacDonald e7218354a8 add all flutter/flutter_test/test isolate deps to the allow list
I also had to migrate package:js to nnbd as a part of this

Bug:https://github.com/dart-lang/sdk/issues/42274
Change-Id: Ia0223e013d2afb464c05eba71783827cf1fb4781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151400
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2020-06-17 04:58:30 +00:00
asiva 4b9aa2bd7e Revert "[VM/Runtime] Cleanup package config initialization code"
This reverts commit 29e93bcdbd.

Reason for revert: Windows bots are failing with package resolution
errors. Looks like we are missing a windows path sanitization step.

Change-Id: Ib56f7e926b4f385fa3fde74c9c71947f64b8be1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151469
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-06-17 00:03:19 +00:00
Leaf Petersen d44457f79d [Core Libraries] Eliminate the fork in the core libraries.
Move the nnbd core libraries from sdk_nnbd to sdk, and updates
references in build files and elsewhere accordingly.

Change-Id: I09760fe1e006657aacdfe80f3b22fdf6f7e30a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151121
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-06-16 23:37:36 +00:00
asiva 29e93bcdbd [VM/Runtime] Cleanup package config initialization code
- Use _Init function for initialization of package config
- Remove DartUtils::SetWorkingDirectory, SingleArgDart_Invoke,
  DartUtils::SetupPackageConfig
- Rename Loader::InitForSnapshot to Loader::Init
- Remove _setPackagesConfig, _setWorkingDirectory from builtin library
- Rename _setPackagesMap to _setPackagesConfig
Change-Id: I0b83574593fa95e1b948134fcd4a7b4858ea19c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151045
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-06-16 23:24:26 +00:00
Paul Berry ed9112e862 Sort declarations in api_test.dart
Change-Id: Ibe2b078f6a38a79d304ad81b1625c72a65fe53c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151320
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-16 21:10:11 +00:00
Paul Berry a9bb706ce2 Migration: allow the client to specify which files to analyze/migrate.
Change-Id: Ie49f003640342a8c0d26b4f509a9268200955dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151302
Reviewed-by: Janice Collins <jcollins@google.com>
2020-06-16 21:10:11 +00:00
Jaime Wren 651464c909 Implement the rest of the ArgumentList ASTNode logic in the context type visitor in feature_computer.dart, tests added in feature_computer_test.dart
Change-Id: I35afea21912a785af427afb317cbff532c29d717
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151364
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-16 20:51:21 +00:00
Brian Wilkerson c7d9fa996b Clean up some unnecessary code in completion manager
Change-Id: Ifdbe46f12b82a521aa079db87fd8c1aba9dd165b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151424
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-16 20:41:01 +00:00
Mike Fairhurst e11eb2cd08 [nnbd_migration] Fix #42263, tool inserting ! on toString/hashCode
Fixed: 42263
Change-Id: Ia4c6d3543bc7628c76b85d986b9709de58925884
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151441
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-16 20:21:31 +00:00
Konstantin Shcheglov 021a49e88c Update the way to get feature set and language version.
https://github.com/dart-lang/sdk/issues/42274
https://github.com/dart-lang/sdk/issues/42321

Change-Id: I5551ecd2803f9d26e720e5cf5671b3be8236bce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151423
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-16 19:05:43 +00:00
Paul Berry d1638508c1 Migration: streamline behavior injection in migration_cli_test.dart.
We now store both environmentVariables and injectArtificialException
in the _MigrationCliTestBase class, and refer to them wherever they
are needed, so we reduce the amount of plumbing we need to do.

In a follow up CL I'll be adding more behavior injection using the
same technique.

Change-Id: Ib736373f7a92a46922964d3c5c59d35bf72d618a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151300
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-16 17:52:10 +00:00
Brian Wilkerson 6d4e7d6830 Fix an exception thrown when a method cannot be resolved because the target type is dynamic
Change-Id: I0479305057a2f763f68aa61c860ab9785d2ca1b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151420
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-16 17:38:30 +00:00
Johnni Winther 7fce125300 [cfe,kernel] Add AstPrinter
This CL adds a Node.toText method together with an AstPrinter. These
facility and better toString implementation on AST nodes while allowing
for toString independent printing of AST to use in testing. This also
add support for an integrated toString of custom/internal nodes.

Some work is still needed in bringing the toString implementation on
all nodes to the old quality, and not all internal nodes have
customized textual representations yet. This work is left for future
CLs.

Change-Id: Ib0bf8a0bc02f489dfacdc8aa5f96da9c52f26058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150923
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-06-16 17:15:10 +00:00
Danny Tuppeny 25f2f7796a Send LSP outlines for all open files
Change-Id: Icd785376c54965c53bd4ea0cf89ede74a4287981
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151390
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
2020-06-16 16:21:50 +00:00
Kevin Moore e1d1adce17 pkg:native_stack_trace - fix sdk version range
Change-Id: I15632e69ecefb9644b2d2e04f6d5096744ad687d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151422
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2020-06-16 16:06:37 +00:00
Sam Rawlins efcb8f9213 Migrator: Do not connect return values to return types on generators
Fixes https://github.com/dart-lang/sdk/issues/42299

Change-Id: I07b3955907efa3007ec146f4cb4170b117b58dcf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151328
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-16 14:08:54 +00:00
Sam Rawlins 61184814e2 Migrator: use dart pub to check outdated
Fixes #42343

This also prevents a crash if the binary-to-execute could not be found.

Change-Id: I19dd9f6dcbb41a5c8b4ef2a04a87c1fc83429120
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151327
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-16 14:08:04 +00:00
Tess Strickland 6f83a5ff9b [vm/aot] Add a GNU build ID to direct-to-ELF snapshots.
For proper crashpad integration, we need to generate a build ID, as the
build ID generated by crashpad if there is not one will be a simple XOR
of the first text page, which rarely changes for Dart snapshots.
Assembly snapshots already have a build ID included by the assembler, so
we currently only do this for ELF snapshots.

Currently the build ID is a 128-bit hash value that is four separate
32-bit hash values concatenated together. Those hash values come from
the contents of the VM and isolate .text and .rodata sections.

This change also contains work to separate out the concepts of sections
and segments in the ELF builder. Now, consecutive allocated sections
with the same write and execute flags are combined into a single PT_LOAD
segment when possible, which reduces the padding needed to ensure that
segments start on page boundaries in ELF snapshots.

Bug: https://github.com/dart-lang/sdk/issues/42020
Change-Id: I42a837dae665a3902d881b8d151b49ede87d6c67
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150625
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-16 12:46:24 +00:00
Johnni Winther 261e283a0a [cfe] Handle explicit type parameter type nullability in bounds
Closes #42143

Change-Id: I05f181889481c48b183cef135f96dbf510ca788d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151381
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-06-16 12:28:04 +00:00
Martin Kustermann 21222b64c4 Revert "[vm] Build dart2native dependencies with the normal "create_sdk" target"
This reverts commit a88a328b7f.

Reason for revert: Auto roller hasn't rolled previous changes from
Dart yet. Those changes updated DEPS for icu/boringssl. We have to
wait with this CL until the DEPS changes have been done in the engine.

Original change's description:
> [vm] Build dart2native dependencies with the normal "create_sdk" target
> 
> This removes special logic for creating the `dart-sdk` we distribute
> which used to build release and product mode and copied some binaries
> from the latter into the former, before the SDK was actuallly ready to
> test and distribute.
> 
> This changes the GN build rules to build the necessary
> gen_snapshot/dart_precompiled_runtime product binaries during the normal
> release build.
> 
> Normally during --mode=product builds the global build config in
> //build/config/BUILDCONFIG.gn will set `-fvisibility=false`.
> 
> => Doing so results in much smaller binaries - because only explicitly
>    exported symbols are visible, the rest can be tree shaken by the linker.
> 
> Since we are building --mode=release, the `-fvisibility=false` will not
> be set. In order to set the flag for the 2 special product-mode binaries
> we need to add -fvisibility=hidden manually, in:
> 
>   * dart_product_config: Which is used for compiling VM sources.
>   * 3rd party double-conversion library
>   * 3rd party boringssl library
>   * 3rd party icu library
> 
> The upstream CLs are:
> 
>   * BoringSSL: https://dart-review.googlesource.com/c/boringssl_gen/+/150482
>   * ICU: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2236407
> 
> Issue https://github.com/dart-lang/sdk/issues/42230
> 
> Change-Id: I3e47664d9fadb9ed1ad033bb17d46e769442f741
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150524
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>

TBR=kustermann@google.com,zra@google.com,athom@google.com,asiva@google.com

Change-Id: Ied0f2f5b58dceb2b59bc2ac6e11e5fd717c8885e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151382
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-06-16 10:41:27 +00:00
Johnni Winther f369194255 [cfe] Add test for extension on Never
Closes #42180

Change-Id: I690d3419d94bfc593f77f0cea75274cb20182ba2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151229
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-06-16 08:10:24 +00:00
Jaime Wren 6021f0aec2 Follow up on https://dart-review.googlesource.com/c/sdk/+/151343, assertOrder() now accepts the order with current.relevance > previous.relevance instead of current.relevance >= previous.relevance, additional tests use assertOrder([]).
Change-Id: I7f7c27d2e3205cc4b556e0fbb1b238a743d281ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151323
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-16 06:55:21 +00:00
Brian Wilkerson 0d3e77d28e Start converting assists to CorrectionProducer
Change-Id: Ie2d12ce8c15a75e8db71434d790c32a76a06b13e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151324
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-16 00:11:28 +00:00
Konstantin Shcheglov 7f6b0d82eb Issue 42337. Report BODY_MIGHT_COMPLETE_NORMALLY for factory constructors.
Bug: https://github.com/dart-lang/sdk/issues/42337
Change-Id: I9209d7bf519ec61026ffe22bb05145e776e8517d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151344
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-15 23:46:38 +00:00
Konstantin Shcheglov 18b753cbcd Support for null-aware ExtensionOverride.
Bug: https://github.com/dart-lang/sdk/issues/41780
Change-Id: Ib5d11000847434c679df1ec882ee6d9777670fe0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151097
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-15 23:45:08 +00:00
Jaime Wren 047f1721a1 Remove the DartCompletionManagerTest and replace it with CompletionRelevanceTest, making all of the completion relevance tests consistent.
Change-Id: I24d042b420a3c1d6f38b063913cb702c34858076
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151343
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-06-15 22:37:04 +00:00
Brian Wilkerson bd3b3299cb Correct an abbreviation
Change-Id: I7424cd587c87f1256237de1cf913b9b0b31104f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151341
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-15 22:16:52 +00:00
Alexander Markov badc77239a [vm/aot] Avoid unbinding canonical names in AOT transformations
AOT transformations (mixin deduplication and TFA tree shaker) were
using CanonicalName.unbind() in order to make sure that kernel
writer will not be able to write dangling references to the deleted
classes or members (to detect such dangling references earlier).

This conflicts with lazy reading from a kernel file if --from-dill
option is used: lazy reader may read a reference to such class after
unbind() and it creates a new Reference object for such canonical name.
This causes crash later when the fresh Reference is used as it doesn't
have Class node filled in.

The solution is to avoid calling CanonicalName.unbind().
Instead, it is enough to nullify node.reference.canonicalName, which
won't break CanonicalName.reference used by lazy reader.

This crash can be reproduced on tests/language_2/vm/regress_flutter_55345_test.dart
if it is compiled in AOT mode using 2-step kernel generation.

Bug: b/158853113
Change-Id: Ib2004dbbbda85d9f56adc56b48882f4ef08869a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151120
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-15 22:00:42 +00:00
Konstantin Shcheglov f2fafcd440 Extract and reuse EnclosingExecutableContext.displayName
Change-Id: If411305b7484e59b234366b656d07d2235e6513d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151305
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-15 20:16:16 +00:00
Stephen Adams cf1681e11e [dart2js] Remove more unused old rti helpers
Change-Id: Icbc50554f2b3ae2cb74b32c9876c7c0cdf15c75b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150640
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-15 18:23:17 +00:00
Jaime Wren 920ddae937 Re-write of the computation of the context type for code completion.  Instead of passing a parent and child node, a parent node with an offset is passed.  The primary purpose of this change was to fix a bug with argument lists which is close to being fixed.
I will follow up with some additional fixes and tests for map and list literals.

Change-Id: I1a26e8f900dcf13402385a49e8f3538c5d1b39df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151030
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-15 18:19:42 +00:00
Sam Rawlins 459255ab09 Migrator: Fix navigating to top-of-file
There is logic to navigate to the top of a newly-loaded page. It
broke with a visual redesign, in which the title of a page is always
sitting at the top of the screen. The new logic will scroll the page
to the first line of source text.

Change-Id: I685d1fb96c6ca1789f114871acd2bb8148e6ae7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151032
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-06-15 18:15:12 +00:00
Danny Tuppeny 25cf204dd2 Prevent duplicate code actions for lines with multiple similar errors
Change-Id: If1a50f3c651efec9ba68fc7be5e50700cfcdb20b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151234
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-15 18:09:02 +00:00
Danny Tuppeny 16ef3ee562 Fix LSP equality checks for lists/maps within unions
Change-Id: I7ec8b591375dfb4d75f802839b89c1288cd4cfef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151236
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-15 18:09:02 +00:00
Danny Tuppeny 3b243a0c30 Recurse through lists/maps when generating hash codes in LSP types
Change-Id: I06117fe33c7bfb8553e9930afbf7e3bdc86c6032
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151230
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-15 18:09:02 +00:00
Konstantin Shcheglov 48f2d10d3e Deprecate ClassElement.hasReferenceToSuper
Change-Id: Ie94d8e2b0be6ccb30c7ca59c80da2832cfed3689
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151168
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-15 17:45:06 +00:00
Konstantin Shcheglov b7efcd276c Report NO_COMBINED_SUPER_SIGNATURE.
https://github.com/dart-lang/language/pull/975

Change-Id: I8ecd191efa84f17d36ea09ef1db33a401c67fda3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151093
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-15 17:42:45 +00:00
Konstantin Shcheglov a1fc2ea80c Make variables assigned in a loop not definitely unassigned anywhere in the loop.
Bug: https://github.com/dart-lang/sdk/issues/42301
Change-Id: I75962b976427cef7f40025f1dcd9f27400306825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151047
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-15 17:29:05 +00:00
Sam Rawlins 28231a790b Analyzer: regenerate diagnostics.md
Change-Id: If0d916b01d802fbdf614ee031f240094fb077931
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151167
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-15 17:24:35 +00:00
Stephen Adams 60ec2b31e6 [dart2js] More sharding of rti_need and rti_emission tests
Both are now sharded 4-ways, which should reduce the individual shards
to about 2 minutes.

Change-Id: I5e8a718a0b5c58b0850015bee76f10df26aee84d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151141
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2020-06-15 16:32:25 +00:00
Johnni Winther 9b4b9ae3a7 [cfe] Fix expectations after adding of FutureOrType
Change-Id: Ia4a6e18062ad215b0db5b44ee447ad615c28690e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151231
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-06-15 16:15:05 +00:00
Paul Berry 2fbe5c1f54 Migration: Make the three migration phases explicit in NonNullableFix API.
Previously the API was general, exposing a `numPhases` integer, and
providing a generic processing function with a `phase` argument.  This
was necessary back when migration was built into DartFix (because
different kinds of fixes had different numbers of phases), but now
that migration is a separate tool, it gets in the way because it makes
it difficult for the caller to have different behaviors in different
phases.

This is a prerequisite for making it possible to have some files
analyzed but not finalized (which is in turn necessary for handling
generated files).

Change-Id: I5993808eb3dace21d8b6cb9c5308f94a3b1f898e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151081
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-15 15:26:48 +00:00
Paul Berry 9f8776f4a9 Migration: split out a MigrationCliRunner API from MigrationCli.
This API can be used by tools that wish to perform migration but want
to provide their own command-line argument parsing.

Change-Id: Ic54e993139c803ded5ac39229ae84980db12184e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151080
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-06-15 15:26:48 +00:00
Paul Berry a7c93201e4 Migration: rework how MigrationCli.run() reports an exit code.
Previously, MigrationCli.run() would always return, but it would set
MigrationCli.exitCode to indicate whether an error occurred.  This
made it necessary to thread a lot of tricky logic around to ensure
that we would exit quickly if an error occurred.  This CL switches to
using an exception, so we get the same effect automatically.

Change-Id: I2b885092dec551700900b118ec3d9acd2f3649d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150760
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-06-15 15:26:48 +00:00
Martin Kustermann a88a328b7f [vm] Build dart2native dependencies with the normal "create_sdk" target
This removes special logic for creating the `dart-sdk` we distribute
which used to build release and product mode and copied some binaries
from the latter into the former, before the SDK was actuallly ready to
test and distribute.

This changes the GN build rules to build the necessary
gen_snapshot/dart_precompiled_runtime product binaries during the normal
release build.

Normally during --mode=product builds the global build config in
//build/config/BUILDCONFIG.gn will set `-fvisibility=false`.

=> Doing so results in much smaller binaries - because only explicitly
   exported symbols are visible, the rest can be tree shaken by the linker.

Since we are building --mode=release, the `-fvisibility=false` will not
be set. In order to set the flag for the 2 special product-mode binaries
we need to add -fvisibility=hidden manually, in:

  * dart_product_config: Which is used for compiling VM sources.
  * 3rd party double-conversion library
  * 3rd party boringssl library
  * 3rd party icu library

The upstream CLs are:

  * BoringSSL: https://dart-review.googlesource.com/c/boringssl_gen/+/150482
  * ICU: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2236407

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

Change-Id: I3e47664d9fadb9ed1ad033bb17d46e769442f741
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150524
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2020-06-15 15:17:35 +00:00
Sam Rawlins 294a2cffd1 Analyzer: print constructor name when constructor returns invalid type
Fixes https://github.com/dart-lang/sdk/issues/27387

Change-Id: I8ce81bab4c4601c5157977d3f43f73903dae7f8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151200
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-15 13:52:56 +00:00
Johnni Winther 28606d040b [cfe] Recompute type parameter type nullability after substitution
Closes #41697

Change-Id: Ib4977aa3f8d97defa7884036a0f561d6ecb4c3ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149587
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-06-15 13:24:26 +00:00
Dmitry Stefantsov 929d5e4a98 [cfe,ddc,dart2js,vm] Add FutureOrType
This CL is the sum of the following 5 CLs:
* https://dart-review.googlesource.com/c/sdk/+/149297/
* https://dart-review.googlesource.com/c/sdk/+/149299/
* https://dart-review.googlesource.com/c/sdk/+/149320/
* https://dart-review.googlesource.com/c/sdk/+/149321/
* https://dart-review.googlesource.com/c/sdk/+/149323/

The reason for landing the 5 CLs as one CL is to prevent potential
troubles with bisecting over the branch because the change is fully
functional only with all 5 CLs.

Closes #40123.

Bug: https://github.com/dart-lang/sdk/issues/40123
Change-Id: Ice52250a98acfe455b1d7fa5bb0624c115ca5dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150934
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-06-15 12:18:46 +00:00
Sam Rawlins b0d4c359d8 Move tests for 4 codes to diagnostics directory.
Also add some tests for function-typed field formal parameters.

Change-Id: Ia6cb23c15e695a540ac3c6df0a7af8110a8fc1f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-14 22:12:07 +00:00
Brian Wilkerson 8d08bbf40a Add a fix for default_list_constructor
Change-Id: Ia7b9c88cfe9528ddddd68935009736c494e57130
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151098
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-06-13 16:29:35 +00:00
Sam Rawlins 32a93e2147 Analyzer: Remove error on class-used-as-mixin referencing super
Fixes https://github.com/dart-lang/sdk/issues/34806

Change-Id: I1cfd0b9c0699734b172aa62f7a04ab533a6cd03f
Fixed: 34806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151099
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-06-13 15:11:25 +00:00
Sam Rawlins 3dc27a55fa Migrator: Add a failing test for #42327
Bug: https://github.com/dart-lang/sdk/issues/42327
Change-Id: I5ac4dbaf95efdc7b54ea4009b78187e519cac92d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151094
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-13 14:31:15 +00:00
Stephen Adams 84d3f3681f [dart2js] pass null for missing required argument in weak mode
Now passing:
language/nnbd/required_named_parameters/required_named_args_legacy_test
language/nnbd/required_named_parameters/required_named_args_weak_test

Change-Id: Ide909eb6eb996ca48c851b45f1069f6562b52d5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151096
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-13 00:15:52 +00:00
Sam Rawlins 213f805294 Migrator: Bump highlight.js to 10.1.0
Fixes https://github.com/dart-lang/sdk/issues/41885

Change-Id: I2c19a36f0eb46e2941ca143c23e2b0be938b7d96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151089
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-12 22:17:12 +00:00
Brian Wilkerson c22dc20a93 Use the const-ness of an element when completing in a const context using available declarations
Change-Id: Ia950ad81ed571cbcf1f0060da0cba26406206ad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151031
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-06-12 22:15:55 +00:00
Sam Rawlins b907f9928f Migrator: Begin flow analysis on top-level annotations
Fixes https://github.com/dart-lang/sdk/issues/42295

Change-Id: I9d224b5c8a3fa5d57f17e434a9e6dfbcebc14781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151026
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-06-12 22:01:32 +00:00
Paul Berry b1442a1f9a Remove unused import
Change-Id: I6d25e5ea3f1fdf320ec85d5f405789e6e8c2ddf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151084
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-12 20:25:39 +00:00
James Lin af054ee91c Adjust documentation to various functions
* Adjust `exit()` documentation to mention `finally` and to further
  emphasize that calling `exit()` does not pass Go and does not
  collect $200.

* Adjust `DateTime.difference` documentation to clarify the sign of
  the returned `Duration`.  Fixes https://github.com/dart-lang/sdk/issues/36347.

* Adjust `String.lastIndexOf` documentation to clarify what is
  returned.  Fixes https://github.com/dart-lang/sdk/issues/41893.

Change-Id: I6ed91e8c79a647928ced7e8f0268a62ed92fbd4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149494
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2020-06-12 20:16:39 +00:00
Konstantin Shcheglov fda4238285 During linking, resolve initializers of constant variables with flow analysis.
Change-Id: I6189cdf86f0e285883da769ceb0b36d6ee85588c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151086
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-12 19:40:18 +00:00
Konstantin Shcheglov 24852421e2 Change method override inference to use combined member signature.
https://github.com/dart-lang/language/pull/975

Change-Id: I5cec14a384b124a29dcd5adac0f0be6e5214cc9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151044
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-12 18:59:28 +00:00
Paul Berry 43131b575e Migration: fix crashes with extension Foo<T extends ...> on T
Change-Id: I3a8f1be4f52a6a49bb57ab032fef668482f5acf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151002
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-12 18:21:15 +00:00
Brian Wilkerson 9be1160700 Do not suggest the keyword const when completing in a constant context
While it isn't an error to use `const` in those contexts, it also isn't
necessary and we already omit `new` because it's never required. This
makes `const` more consistent with `new`.

Change-Id: Ia577065d53ab57543b86161f5e62e3947ff9a2a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151029
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-12 16:32:40 +00:00
Brian Wilkerson 3a31bc2fd4 Update relevance metrics to compute element kind probabilities based on whether type parameters are in scope
Change-Id: I1b85f7723c0eed0a0287dc794daecbd6acbc162b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151060
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-12 16:28:36 +00:00
Sam Rawlins 56dbe294f2 Analyzer: Do not report const constructors with mixed in synthetic fields
Fixes https://github.com/dart-lang/sdk/issues/37810

Also report the offending fields in the error.

Change-Id: I8328bf5f16f56f1b70bbe4bdb7623ade6f11943c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151027
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-12 16:24:35 +00:00
Danny Tuppeny 2f2efeb07a Filter LSP definitions to not include variable names
Fixes https://github.com/Dart-Code/Dart-Code/issues/2535.

Change-Id: I2e64d0cd53abcde4ac3ecae1682b6b054b16407a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150980
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-12 14:38:44 +00:00
Danny Tuppeny 7b12c8e06d Add fixes for extends_non_class
Bug: https://github.com/Dart-Code/Dart-Code/issues/2536
Change-Id: I5e4fa5a3625016045d86462b941cee3c73a36a04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150932
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-12 14:12:34 +00:00