Commit graph

33170 commits

Author SHA1 Message Date
Johnni Winther 267a061c2b [kernel] Clone Block.fileEndOffset
+ remove redundant clone of fileOffset.

Change-Id: Ie13e35a710e8496da4e93b858ee18b54dd0d551f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170960
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-09 20:59:14 +00:00
Danny Tuppeny 4c85f1950b Send LSP unhandled exceptions to instrumentation service
Change-Id: Id8e876b7144aa98dc7c219b9eec2c140824f9675
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170427
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
2020-11-09 20:06:14 +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
Dmitry Stefantsov 783d83950b [cfe] Use type parser in type schema elimination tests
Closes: #44095.

Bug: https://github.com/dart-lang/sdk/issues/44095
Change-Id: Iff15b0686557388c4e701075a4f6e4fc16dfa5fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170901
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-11-09 16:54:39 +00:00
Paul Berry 785c3258f6 Migration: remove deprecated code related to flag --skip-pub-outdated.
This flag was removed in
https://dart-review.googlesource.com/c/sdk/+/170561, but some of the
code related to it was deprecated and retained in order to avoid
breaking an internal client.  The internal client has now been
updated, so we no longer need the deprecated code.

Bug: https://github.com/dart-lang/sdk/issues/44061
Change-Id: I08cbb7a617a349c2a4debbe342643de817bc86b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171000
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-09 14:36:38 +00:00
Paul Berry f4001df118 Migration: include exports when checking that imports are migrated.
When I first implemented this I thought that checking exports wasn't
needed, since it's not allowed for a migrated library to re-export
symbols defined in an unmigtated library.  But it turns out we still
do need to include exports in the check, since there might be migrated
libraries that are only reachable in the transitive dependency graph
via an export, and we need to check that *those* libraries don't
import unmigrated code.

Bug: https://github.com/dart-lang/sdk/issues/44061
Change-Id: I280b4117373a3320fc1efe65abe24e344199754c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170840
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-09 13:16:34 +00:00
Johnni Winther a1f67241b9 [cfe] Handle required parameters in combined member signature creation
Change-Id: I4ee6a6f1f404a65e7abc926adaa08178698838e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170880
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-09 11:47:24 +00:00
Johnni Winther 38d7c7661d [cfe] Special case Null in assignability errors.
In error reporting on assignability where the expression has type
`Null` we use a special messages that doesn't state that
"'Null' is nullable". Cases where `Null` is part of the type or where
the expression of type `Null` is derived from a collection are not
special cased.

Closes #43998
Closes #44093

Change-Id: Ic0c79e6362f2365eb3fe8222ccd2ef8fac4f188d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170433
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-11-09 11:07:44 +00:00
Johnni Winther f27e0f96b4 [cfe] Add test to verify issue 31767 has been fixed
Closes #31767

Change-Id: I729514a172a924fb96183a9ba7978ae347560d5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170821
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-09 10:28:23 +00:00
Johnni Winther 1930c07cd7 [cfe] Add flags to MethodInvocation and fileEndOffset to Block
The CL add a 'flags' to MethodInvocation with the properties isInvariant
and isBoundsSafe. The former is used for to marks safe calls in unified
collection encoding. Both can be used further by backends.

The CL also adds a 'fileEndOffset' to Block. This is current set for
block declared in used code.

In response to https://github.com/dart-lang/sdk/issues/43994
and https://github.com/dart-lang/sdk/issues/43965

Change-Id: I579fc2928331465dfc2c152ccfd21297b12cfdd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170695
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-09 07:36:44 +00:00
Devon Carew 5871cfb23c [analysis server] remove older analysis server flags
Change-Id: I4384c98a067467def91e2b769d711069ad057a27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170801
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-11-09 03:54:58 +00:00
Sam Rawlins d8903669be Quick fix: make a parameter nullable
Closes https://github.com/dart-lang/sdk/issues/44098

Change-Id: Ib3bb0b352f33a027c79746418033497aee1d8a7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170763
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-09 01:19:07 +00:00
Sam Rawlins ae4e13a0a0 Analyzer: prepare for migration, mostly with explicit casts
Change-Id: Ic7565765d67a6b07c9028ad70f285cf0ed9de855
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170802
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-08 18:13:47 +00:00
Paul Berry 9b4cbf46b8 Migration: clarify the "unmigrated dependencies" warning text.
The old phrasing was confusing because it was unclear which libraries
were being referred to.

Bug: https://github.com/dart-lang/sdk/issues/44061
Change-Id: Id68f28fcd8ba5a80763e7bf86d6774289701d381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170841
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2020-11-08 17:00:17 +00:00
Devon Carew beb56d51f6 [pkg/nnbd_migration] remove a leading space from a message
Change-Id: Ida7bc63a1aa90e252b3bd65263f5d0a72e906c87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170747
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-07 22:02:26 +00:00
Sam Rawlins 594f0fd51d Analyzer: Delete unused class in source_factory_test
Change-Id: Ia46e3cec3addc18c69259587d5186f9ec078cbfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170761
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-06 22:40:13 +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
Ben Konyi df9597169a [ CLI ] Update experiment parsing
Continuation of https://dart-review.googlesource.com/c/sdk/+/169902

Change-Id: Ia971f75aa81c2b5d8696c35f3d16ff53c29f874a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170460
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-06 20:44:43 +00:00
Ben Konyi d2775733a6 Reland "[ DDS ] Keep event history for Stdout, Stderr, and Extension streams"
This reverts commit a486752050.

Change-Id: I112a907792b5cbfd4a1ee0eb96898dc931c92f23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170480
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-11-06 19:02:23 +00:00
Dmitry Stefantsov b66fbd1829 [cfe] Use type parser in legacy upper bound tests
Closes #44094.

Bug: https://github.com/dart-lang/sdk/issues/44094
Change-Id: Ib32a25545b65a91f951ee613276e7c275a91a739
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170698
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-11-06 17:00:03 +00:00
Sigurd Meldgaard 9d132ebba9 Bump pub
New commits:

git log --format="%C(auto) %h %s" 900e796a37fd9f68de9dd183cf4798fe5f055eaa..4ca4767a6c00b2dadecdaee9a4866dae40ef25f2
 4ca4767a Added a dart pub outdated --transitive option (#2731)
 6b145bd6 Deprecate --server argument to `pub publish` and `pub uploader`. (#2697)
 7737023a don't warn if previous prerelease was null safe (#2730)
 62f92838 Improve outdated --mode=null-safety (#2724)
 cc589ec3 Change message for no Latest resolution (#2729)
 656803e9 Require sdk constraint (#2718)
 8309d877 Added test that dev_dependency does not trigger null-safety warnings when publishing (#2727)
 332ea049 Remove warning about mixed mode. (#2723)
 a98a1f23 Simplify null-safety analysis in `pub outdated --mode=null-safety` (#2721)
 5fba2015 Outdated null safety implies prereleases (#2722)
 fb9ec4af Fixed bug in yaml_edit (#2703)

Change-Id: I22a084aee06542e04a272269fb0134f0ac62f779
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170690
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2020-11-06 15:36:02 +00:00
Sam Rawlins 466f2fd8a7 Analyzer: prepare some generated/ tests for null safety
Change-Id: Ieca714d8b32b7b283a8dc30dd820df07d1e64655
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170600
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-06 14:34:02 +00:00
Clement Skau e90967f29d [SDK] Makes --lazy_async_stack default.
Bug: https://github.com/dart-lang/sdk/issues/42062
Change-Id: If22ed42b363e2d75d0be5cc14aef9e909b8ff2e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149288
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-06 14:12:52 +00:00
Dmitry Stefantsov d54e2bb568 [cfe,ddc,dart2js,vm] Add NullType
This CL is the sum of the following 5 CLs:
* https://dart-review.googlesource.com/c/sdk/+/170342/
* https://dart-review.googlesource.com/c/sdk/+/170344/
* https://dart-review.googlesource.com/c/sdk/+/170345/
* https://dart-review.googlesource.com/c/sdk/+/170346/
* https://dart-review.googlesource.com/c/sdk/+/170347/

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 #40122.

TEST=Verified by changes in .expect files in pkg/vm/.
Bug: https://github.com/dart-lang/sdk/issues/40122
Change-Id: Ib8197802fdc69694387ae47ac990c58b3aaab7a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170689
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-11-06 12:43:52 +00:00
Johnni Winther 1876c6751b [cfe] Add test for forwarding stub targets
The added test show that we generate a super call to the wrong target
in some forwarding stubs. The target should have been the mixed in
member but is instead the super member that it overrides.

Change-Id: If7536628370ba69405cbedef969e727a5d220058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170684
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-06 11:48:33 +00:00
Sigurd Meldgaard cd970af91a [Dart CLI] Embed pub in dartdev
This includes the following pub commits:

 git log --format="%C(auto) %h %s" 5b4df5a6f931c63622ac349602d6ef0367e8070f..fb72c1f774ca27556225b207185c0b6b6ab1c274
 fb72c1f7 Make `run` available (but deprecated) in the embedding (#2698)
 63b56ea4 Return the exit-code from commands (#2689)
 7fc4e273 Deprecate top level (#2694)

Change-Id: I5842b1ecb15fc7844d628e2ad5fb00e3f627dbff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168347
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2020-11-06 08:30:12 +00:00
Paul Berry 7322bc027e Migration: replace pub outdated check with a check on transitive imports.
Instead of running `pub outdated` to see if the user's dependencies
have been migrated yet, the migration tool now examines all of the
transitive import dependencies of the user's code to see if they are
opted in to null safety.  This produces a more accurate result than
`pub outdated`, because it is able to ignore files in transitive
package dependencies that aren't reachable via imports
(e.g. references to `package:analyzer` brought in by `package:test`).

Fixes #44061.

Bug: https://github.com/dart-lang/sdk/issues/44061
Change-Id: I38465bcbf35e8552f0060b5d51c0f1cfc5d18c7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170561
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-11-05 23:05:51 +00:00
Sam Rawlins 40cfccda6f Migrator: Add a progress bar for explainMigration, which can take a long time.
This shows progress for work which happens after the migration suggestions have
been generated. This work is generating instrumentation details for the front
end.

When migrating the analyzer package, the progress indicated by this third
progress bar takes approximately the same time as generating suggestions (on
the same order of magnitude).

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

Change-Id: I0b40dd5e587b718bd1ef56d64f03929924cc430a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170563
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-05 22:10:51 +00:00
pq a15b252c28 overlapping fix test
Change-Id: I4621e8e24b8d296875d2033ac21ba8da68fb0387
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-11-05 21:14:31 +00:00
Paul Berry 9d3b932640 Migration: fix handling of .call tearoff on a function-typed expression.
Change-Id: I18b102ae83afdb051decfc26762619fb5746f73f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170364
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-05 19:18:54 +00:00
Sam Rawlins d01694d8aa Migrator: Do not overflow progress bar, or print warnings before ticks
Fixes https://github.com/dart-lang/sdk/issues/43752

Change-Id: I538b283b1cabe2b2212ada30317c14e76e182a06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170562
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-11-05 19:08:14 +00:00
Paul Berry e8c8e51139 Migration: opt in dependencies in migration unit tests
Early in the development of the migration tool, due to language
versioning support being incomplete, it didn't have a good way to
distinguish opted in from opted out code, so we had the convention
that any code not being migrated was opted in.  Now that we have
language versioning support, we need to explicitly opt that code in.

Without this change, we'll get bogus failures when we add logic to
detect unmigrated dependencies.

Bug: https://github.com/dart-lang/sdk/issues/44061
Change-Id: I12920ea75b8af2142a044314b89b76bb602897c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170560
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-05 18:16:57 +00:00
Sam Rawlins 9e6486fe3f Analyzer: Make test fields late, late final, or hinted for migration.
Many fields can be late or late final, so adding hints for the migration tool.

In SnippetTester, the fields are all set in the constructor. Added a factory
constructor so the fields can be final. Renamed them to be private.

Change-Id: I559e7ba92c7c6749038630b03f67f8a77bdc704a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170406
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-05 17:45:17 +00:00
Sam Rawlins e56e5104cf Analyzer: prep file_system tests for null safety.
Fields initialized in `setUp` are late.

Variables initialized with implicit casts like:

    ClassDeclaration clazz = unit.declarations[0];

would need a cast:

    ClassDeclaration clazz = unit.declarations[0] as ClassDeclaration;

so they are updated to use var, which is more idiomatic:

    var clazz = unit.declarations[0] as ClassDeclaration;

Change-Id: I4e4ae814a814d3a4200c5078a6904dbac0a8140c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170520
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-05 17:39:37 +00:00
Erik Ernst d13eaddf97 Lower aliased redirecting factory constructor invocations
Change-Id: I281f959b94d6e9dc2d7f7c6e4923cc841897041b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170431
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-11-05 15:17:43 +00:00
Erik Ernst 3a7eeb6315 Rename is{Strong,Weak}Mode to has{Sound,Unsound}NullSafety
Change-Id: If3912d75c5f89a741299b2fae4299d01ac928eec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170424
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2020-11-05 14:26:53 +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
Clement Skau 27ca552ddb [SDK] Replaces async's _AsyncAwaitCompleter with _Future.
Run time (less is better) impact:
dart:
- Calls.AwaitAsyncCall  -43.95% ~ -55.50%
- Calls.AwaitAsyncCallClosureTargetPolymorphic  -40.33% ~ -53.58%
- Calls.AwaitAsyncCallInstanceTargetPolymorphic  -42.69% ~ -55.65%
- Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits  -42.05% ~ -56.14%
- Calls.Await...  0% ~ -13%
dart-aot:
- Calls.AwaitAsyncCall  -9.748% ~ -11.13%
- Calls.AwaitAsyncCallClosureTargetPolymorphic  -8.673% ~ -13.19%
- Calls.AwaitAsyncCallInstanceTargetPolymorphic  -9.799% ~ -11.74%
- Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits  -5.412% ~ -13.43%

Code size impact:
- flutter_gallery_app_so_brotli_size  -0.1237% ~ -0.2410%
- flutter_gallery_readonlydata_size  0.1693% ~ 0.2041%
- flutter_gallery_instructions_size  0.1157% ~ 0.1779%
- flutter_gallery_total_size  0.1021% ~ 0.1413%

Bug: https://github.com/dart-lang/sdk/issues/39119
Change-Id: I64d28a8bea078277946d7be43737e265920c8f16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126322
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-05 09:51:13 +00:00
Jens Johansen 7b75bd8ece [CFE] Special case StrongModeNNBDPackageOptOut message in IncrementalCompiler
This CL fixes the wrong message, so - when in the process of fixing
the package nnbd settings - one gets the correct message, mentioning the
right packages and no longer mentioning the fixed ones.

Change-Id: Ied26094055e56b44dfdd2e942b98eb9e1e7968fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170423
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-11-05 09:43:23 +00:00
Jens Johansen 60a5c58196 [CFE] Fix not getting rid of NNBD error in package in incremental compiler
This fixes the issue of the error not going away, but can (see added
test) give a wrong error message when in the process of fixing the issues.

A follow-up CL will (try to) correct the wrong error message.

Change-Id: I3547fe5fb5cfd179897996029a00a4995a967e54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170422
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-11-05 08:47:42 +00:00
Stephen Adams f387d24f68 [js_runtime] List.of improvements
`List.of` avoids per-element checks and no longer forwards to
the more expensive `List.from`.

Global type inference infers `List.of` and `List.from` as new
list allocations.

Bug: 40211
Bug: 32937

Change-Id: I54746610a1b0089ec54e43459301720105f872ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170127
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-11-05 01:47:17 +00:00
Konstantin Shcheglov 2513d37525 Fix reported void_checks diagnostics.
Change-Id: I49b27cf3aab3606fb5b024cba3ed4b95e9ebe0f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 23:50:37 +00:00
pq b5f1bbb2d7 simple fix dry-run
See: https://github.com/dart-lang/sdk/issues/43746

Change-Id: I0856471c22b2bb6f4487cca1147b8ad26fd29f93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170405
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 22:41:07 +00:00
Brian Wilkerson 2d4070fa34 Fix a bug when adding a named parameter after removing all existing parameters
Change-Id: Ib43b154fb781ff50d32f4259ef198857835f9135
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170404
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-11-04 21:02:37 +00:00
Jonas Finnemann Jensen 65700b8940 Remove global variables from analytics in dartdev
Change-Id: Ic2b27ae5d1062c8227d082a050056685a3380c77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170089
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-11-04 19:26:37 +00:00
Paul Berry 221c697f31 Migration: fix handling of .call on a function-typed expression.
Change-Id: Ibdee57d455215cd974ea34c8aeab578bd801f87b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170361
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-11-04 18:28:17 +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
Danny Tuppeny 648debb622 [Analyzer] Prevent NPE in Surround With assist
Fixes https://github.com/dart-lang/sdk/issues/42556.

Change-Id: I5d38fcbd7932a43da0ca40140cefdef593d6ea8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
2020-11-04 17:52:17 +00:00
Ivan Inozemtsev 4a46b6511e Revert "[pkg/dartdev] refactor the migrate command to subclass DartdevCommand"
This reverts commit c10be63d51.

Reason for revert: this creates a circular dependency between nnbd_migration and dartdev which is hard to support internally

Original change's description:
> [pkg/dartdev] refactor the migrate command to subclass DartdevCommand
>
> Change-Id: I60f91f14e066b3a173f45b3c988830d5b435f2ed
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170206
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Devon Carew <devoncarew@google.com>

TBR=devoncarew@google.com,bkonyi@google.com,sigurdm@google.com

Change-Id: I3ba4648ea7f879ea4a893df2a9d75581a6f48dec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170348
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2020-11-04 17:22:59 +00:00