Commit Graph

25510 Commits

Author SHA1 Message Date
Kevin Millikin be79eb4517 Ship experiment 'set-literals'
Change-Id: Ief182017752b87ef099ac5140ff781cbb14d76a9
Reviewed-on: https://dart-review.googlesource.com/c/92125
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-02-08 16:17:55 +00:00
Dmitry Stefantsov 88fea76f58 [kernel] Add text (de)serialization for simple function types
Change-Id: Ied1be7c530793f94fea0c71ef8112a4524d6b815
Reviewed-on: https://dart-review.googlesource.com/c/92289
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-02-08 13:39:35 +00:00
Paul Berry 5b7b34eb3a Add a "permissive mode" to the nullability migration tool.
This allows us to try it out on substantial codebases (e.g. the
analyzer itself) without crashing, even though a lot of the underlying
logic is not yet complete.

Change-Id: I24a45eea1889f7d9afa30c0398f359d32ffb52ad
Reviewed-on: https://dart-review.googlesource.com/c/92404
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-08 13:23:35 +00:00
Johnni Winther 60527d7b97 Support computation of ResolutionImpact through ImpactData based on kernel
This is a pre-step to modularizing the world impact computation.

Change-Id: I4f59f9767e7399fdcf9a070074864e6873b61a52
Reviewed-on: https://dart-review.googlesource.com/c/92044
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-08 12:02:33 +00:00
Johnni Winther 52f5e34dbf Move JsToFrontendMap to js_world_builder and add toBackendConstant.
We had two implementations of TypeConverter. These are now merged.
Since native behavior can contain free function type variables the
type converter currently conditionally allow these.

Change-Id: I4591d4b628a9eb75b1316a1884e82b31f2fca97f
Reviewed-on: https://dart-review.googlesource.com/c/92286
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-08 10:16:58 +00:00
Johnni Winther 30d760e0c9 Add unittest of allocator analysis for the K model
This is a prestep towards tracking initialization through field
initializers with the aim at discovering effectively constant instance
fields.

Change-Id: Iefc36382589e4fbe03e1bc4314230f62fb925b9a
Reviewed-on: https://dart-review.googlesource.com/c/92265
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2019-02-08 10:09:49 +00:00
Johnni Winther 45f55183c5 Refactor processing of pragma annotations
Change-Id: I3d4efdab560557d5d9bbab748d003cd360efbe3d
Reviewed-on: https://dart-review.googlesource.com/c/92264
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-08 09:55:28 +00:00
Johnni Winther 3fab17ee58 Display CFE message contexts
Change-Id: I6e1ab11a3520e284e9adef2210249a171cfc1eab
Reviewed-on: https://dart-review.googlesource.com/c/92285
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-02-08 09:01:29 +00:00
Jenny Messerly 246430bc8c [dartdevc] wait for async callbacks to complete in tests
This change ensures that DDC tests won't accidentally "pass", and then
silently fail or timeout later, when the async tests actually run.

Change-Id: Id18d3343e5dadcf266f39568a93381daf4c54e1c
Reviewed-on: https://dart-review.googlesource.com/c/92247
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2019-02-08 01:30:58 +00:00
danrubel 26379d088d Update dartfix to report path of resource if resource changes during analysis
Change-Id: Ia537083013173f9a0dafd174f55bed11ec09d95c
Reviewed-on: https://dart-review.googlesource.com/c/92360
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-07 22:05:49 +00:00
Konstantin Shcheglov da7ed9b05a Add missing generics in FlowAnalysis.
R=paulberry@google.com

Change-Id: I8e7334ad68bdb8080b8dce90a726284b6bd88b64
Reviewed-on: https://dart-review.googlesource.com/c/92244
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-07 21:17:07 +00:00
danrubel 21b596e1b1 Change NullabilityFixKind from enum to class
... so that it can carry additional information
such as an applied message for use by dartfix.

Change-Id: Ic98f4000590c9bf21be45c5a5139946afeeb196c
Reviewed-on: https://dart-review.googlesource.com/c/92302
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-07 20:47:37 +00:00
danrubel d84ec89f39 add NullabilityMigrationListener for communicating changes to the client
Change-Id: If6c9cefd0f43edab3a6731f606b4be9a0934e540
Reviewed-on: https://dart-review.googlesource.com/c/92242
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-07 20:47:37 +00:00
danrubel 9f0301630f Update dartfix NNBD to use 2-pass analysis
Change-Id: Icc7c1b29c6abeed968372c3a7442fdcecda0e572
Reviewed-on: https://dart-review.googlesource.com/c/92152
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-07 20:47:37 +00:00
Konstantin Shcheglov 70283bdb3a Improve choosing context for changes files.
This should fix the Windows bot failure in Analysis Server.

R=brianwilkerson@google.com

Change-Id: I50cc69f7c0f60d955d8bb96cacc740e2d0c8d45e
Reviewed-on: https://dart-review.googlesource.com/c/92304
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-07 20:43:40 +00:00
Aart Bik dbf4900c99 [vm/tools] Fix issues with snapshot size reporting
Rationale:
This fixes the following three issues to get byte-exact
snapshot size difference reporting, which makes optimizing
for code size a lot easier.

Issues:
(1) reports the slightly more accurate raw size
(2) accumulates dups in the json
    (before we only did bookkeeping for one)
(3) avoid non-deterministic parts in names
    (this resulted in reporting baffling method size
     differences against the same layout, even though
     the aggregate difference added up to 0).

https://github.com/dart-lang/sdk/issues/35323

Change-Id: Ia6abe50ab8694fe54906e28a3b3375ed99ace9df
Reviewed-on: https://dart-review.googlesource.com/c/92320
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-02-07 19:42:26 +00:00
Konstantin Shcheglov 073f557b1a Temporary fix for Analysis Server tests on Windows.
This requires a biggest fix in the declarations tracker, we need to
improve the way we find changed file URIs.

R=brianwilkerson@google.com

Change-Id: I5332434102525fa6730d17605fe1e466f6d397e5
Reviewed-on: https://dart-review.googlesource.com/c/92300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-07 17:02:21 +00:00
Aske Simon Christensen ac95355fdb Compiler option for environment defines
Change-Id: I50f0085ebbc2c9a3af26769a0004bfb8361d85f2
Reviewed-on: https://dart-review.googlesource.com/c/91340
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-02-07 16:15:52 +00:00
Peter von der Ahé 0e4f917759 Implement subtyping of optional function parameters
Change-Id: I25e7fecf8c3080c1558f6a2d499b9ca618b42824
Reviewed-on: https://dart-review.googlesource.com/c/92122
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2019-02-07 14:10:01 +00:00
Peter von der Ahé c84a0bd932 Infer mixin applications in hierarchy builder
Change-Id: Ic58e4a14f4ff4601bec157364b1262283374383f
Reviewed-on: https://dart-review.googlesource.com/c/92051
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-02-07 14:10:01 +00:00
Peter von der Ahé 2fd96e75d6 Separate MixinInferrer from Kernel ClassHierarchy
Change-Id: If05db17e6ad7625015b3edf2f74081d81ebbf70d
Reviewed-on: https://dart-review.googlesource.com/c/92050
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-02-07 14:10:01 +00:00
Peter von der Ahé 8927bc8d38 Remove ConstraintGatherer's dependency on TypeSchemaEnvironment
Change-Id: I4f371d327033afeb8d36556b9e1d1dde4e2dd5f1
Reviewed-on: https://dart-review.googlesource.com/c/92049
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-02-07 14:10:01 +00:00
Peter von der Ahé 5a98aa704b Extract StandardBounds to a mixin
Change-Id: I2bbae29fa4306ef45795cc11aec19bc2ada46aa2
Reviewed-on: https://dart-review.googlesource.com/c/92048
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-02-07 14:10:01 +00:00
Peter von der Ahé 86f5aed890 Finish implementing IsTypedefSubtypeOf
Change-Id: Ib62f2100a85e10e4ef1eed3ed12144a90bc5e714
Reviewed-on: https://dart-review.googlesource.com/c/92043
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-02-07 14:10:01 +00:00
Peter von der Ahé a8a9171dd8 Avoid crashing on this property access
Fixes https://github.com/dart-lang/sdk/issues/35875

Change-Id: I5ae2f73cd792aae165e787d7856b0af9a7c2e19e
Reviewed-on: https://dart-review.googlesource.com/c/92282
Commit-Queue: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-02-07 12:12:19 +00:00
Johnni Winther 33bc628235 Treeshake unread fields
Change-Id: I188df5fd18163e5b32213a364d0fc163300db7b9
Reviewed-on: https://dart-review.googlesource.com/c/92130
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-07 09:58:19 +00:00
Peter von der Ahé b040d3c853 Improve error message on ambiguous constructors
Fixes https://github.com/dart-lang/sdk/issues/34515

Change-Id: Ibbecab411515309db9f45f7b59283f54d878223a
Reviewed-on: https://dart-review.googlesource.com/c/92261
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-02-07 09:51:49 +00:00
Johnni Winther c591454dd3 Inline unprovided optional parameters
Change-Id: I61c82216965062feee8e01ba2533d0ea7c0052ef
Reviewed-on: https://dart-review.googlesource.com/c/90700
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-02-07 08:44:49 +00:00
danrubel 3afc3b58d0 Add dartfix protocol integration tests
... and address comments in https://dart-review.googlesource.com/c/sdk/+/91780

Change-Id: Ibd01a0de575065cf18822b806a9c687de2667add
Reviewed-on: https://dart-review.googlesource.com/c/92243
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-07 06:21:57 +00:00
Konstantin Shcheglov 67a1ce6b34 Notify DeclarationsTracker about file changes.
R=brianwilkerson@google.com

Change-Id: Iedbd695a184cefb384195ac56cffcf34c17806e7
Reviewed-on: https://dart-review.googlesource.com/c/92154
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-07 02:03:17 +00:00
Konstantin Shcheglov 876e671a2c Migrate DeclarationResolverTest.
R=brianwilkerson@google.com

Change-Id: I553e871b2193d6219528df648f44e246c6391888
Reviewed-on: https://dart-review.googlesource.com/c/92222
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-07 02:01:36 +00:00
danrubel 6c680a0ebd Update dartfix readme and update version numbers
* Update the readme to discuss required vs suggested fixes
* Remove the out-of-date options section from the readme
* Update dartfix and analysis_server_client versions and changelog

Change-Id: Ida4b30f9f89eb84a2fe856f61562ff73bf6725da
Reviewed-on: https://dart-review.googlesource.com/c/92153
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2019-02-07 01:16:56 +00:00
Konstantin Shcheglov 33337cf8d0 Fix API breakage, reexport ConstantEvaluator.
Fixes non-API breakage done in https://dart-review.googlesource.com/c/sdk/+/92080

R=brianwilkerson@google.com

Change-Id: Iaec482c341b11e260594d56e42bb6904d376e24d
Reviewed-on: https://dart-review.googlesource.com/c/92169
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-07 00:27:23 +00:00
Paul Berry c2cdc1c639 Allow migration of multiple files at once.
Change-Id: I1940ab2da69327132eb71fbd839b9ac726dc7529
Reviewed-on: https://dart-review.googlesource.com/c/92240
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-07 00:02:04 +00:00
Paul Berry d68d8526f4 Allow nullabilty migration prepareInput/processInput to operate on different ASTs.
This required modifying the implementation of nullability migration so
that it no longer holds onto AST nodes, but instead records sources
and offsets.  This will allow the tool to scale to large projects
since the AST for one file can be garbage collected while the AST for
another file is analyzed.

Additional changes:

- provisional_api_test.dart is updated so that it tests the API in two
  ways: once feeding identical ASTs to prepareInput/processInput, and
  once feeding conceptually equal (but not identical) ASTs.

- The internal analyzer API is changed so that the finish() method
  simply returns a list of modifications, rather than a map from path
  to modification list.

- Files are tracked by Source rather than by path.

- Modification objects remember their Source (this should pave the way
  for allowing multiple files to be migrated in a single run of the
  tool).

- The Variables class is split in two, with the methods needed for
  testing in a private class inside migration_test.dart.  These test
  methods can retain pointers to AST nodes without creating
  scalability problems for the production code.

Change-Id: Idd3f3b6893a25bb4294b4b4c820e20e4bc47ffd8
Reviewed-on: https://dart-review.googlesource.com/c/92220
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-06 23:58:40 +00:00
Paul Berry ba9fbda83e Rework provisional migration API.
Instead of returning a list of SourceFileEdit objects, we now return a
list of SingleNullabilityFix objects.  Each SingleNullabilityFix can
be queried to determine (a) which source file it applies to, (b) the
exact set of source edits to apply, and (c) the kind of change.
Future CLs will add the ability to query (d) the location of the
change, and (e) the reason for the change.

Change-Id: I5a42958ac70d1e39802efd5915d0856109b4a7db
Reviewed-on: https://dart-review.googlesource.com/c/92151
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-06 23:20:41 +00:00
Alan Knight f0d5cb73a9 Guard the custom formatter for a Map against errors
Change-Id: Iee245fffb7bd2d19b55b8007d7c3afb17acf0577
Reviewed-on: https://dart-review.googlesource.com/c/92143
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Alan Knight <alanknight@google.com>
2019-02-06 21:44:40 +00:00
Brian Wilkerson df779789f2 Support two more cases in the convert-to-spread assist (issue 35867)
Change-Id: I3762df7627045af3e023037aef1109afefb176ff
Reviewed-on: https://dart-review.googlesource.com/c/92165
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-06 21:36:01 +00:00
Konstantin Shcheglov fd2225ab6c Adapt to the flow analysis spec v2.
R=paulberry@google.com

Change-Id: I42ad94079233516007bec6285088d3d8245a4edd
Reviewed-on: https://dart-review.googlesource.com/c/92160
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-02-06 20:11:12 +00:00
danrubel caa8747a37 Rework dartfix NNBD fix to use new NullabilityMigration engine
... add address comment in https://dart-review.googlesource.com/c/sdk/+/92082

Change-Id: Id9b400522e8c9af3d04ca5524174a61a8045d9d7
Reviewed-on: https://dart-review.googlesource.com/c/92141
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-06 19:49:35 +00:00
Konstantin Shcheglov ae5bd68570 Lower relevance of deprecated suggestion sets.
R=brianwilkerson@google.com

Change-Id: I3b10c74d815c69f120238a6fd5028ae534fc7446
Reviewed-on: https://dart-review.googlesource.com/c/92142
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-06 19:38:30 +00:00
Konstantin Shcheglov adfa4791fc Improve storage for available declarations.
1. Getters and setters.

2. Parameters.

3. Restore null where should when reading from flatbuffers.

R=brianwilkerson@google.com

Change-Id: I934e828ced6ae21c1c633c2a94e3336078eb2747
Reviewed-on: https://dart-review.googlesource.com/c/92084
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-06 17:35:45 +00:00
Konstantin Shcheglov 033cb7ffcc Issue 1438. Use expression function body for createState().
R=brianwilkerson@google.com

Bug: https://github.com/Dart-Code/Dart-Code/issues/1438
Change-Id: Id68e047233722d35b0ff4c08a8244d53c8e26e81
Reviewed-on: https://dart-review.googlesource.com/c/92101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-06 17:02:41 +00:00
Konstantin Shcheglov c3542cbc3b Set relevance for IncludedSuggestionSet.
We prefer libraries already imported in the target library.

R=brianwilkerson@google.com

Change-Id: I6a52071753e9986bf37b21899cfa59026d7cdc68
Reviewed-on: https://dart-review.googlesource.com/c/92083
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-06 17:00:55 +00:00
Konstantin Shcheglov 661e91e30e Extract and migrate tests for ConstantEvaluator.
R=brianwilkerson@google.com

Change-Id: Ia637dbe78a710678153cfc74726bf4825e36f755
Reviewed-on: https://dart-review.googlesource.com/c/92080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-06 16:54:35 +00:00
Konstantin Shcheglov cc74e20eee Make some fields on Interface private, and change the way InheritanceManager2 is tested.
R=brianwilkerson@google.com

Change-Id: I960e512fa7d91fc64e66595419a1fbd358d68e2f
Reviewed-on: https://dart-review.googlesource.com/c/92065
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-06 16:52:50 +00:00
danrubel 512e2ef292 Extract FixCodeTask/Processor from main dartfix class
Change-Id: Ieb8c52c1908521f77c6a5a13809fbe5636ee5b5a
Reviewed-on: https://dart-review.googlesource.com/c/92082
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-06 16:45:05 +00:00
danrubel e4755b34ba Extract FixLintTask/Processor from main dartfix class
Change-Id: I60dfc00898ca5ee07fc4dc2e010214790bf3343b
Reviewed-on: https://dart-review.googlesource.com/c/92081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-06 16:45:05 +00:00
danrubel 1e8f9bf63a Extract FixErrorTask/Processor from main dartfix class
Change-Id: I6f5715d19a739295648963bae5a0705addfe5265
Reviewed-on: https://dart-review.googlesource.com/c/92100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-06 16:45:05 +00:00
danrubel 5ae156e055 Extract DartFixListener to record source changes and recommendations
... and add DartFixRegistrar in preparation for extracting tasks
from the main dartfix class.

Change-Id: I6423a474fc5d94d766d9b219fb31a4263db28d1b
Reviewed-on: https://dart-review.googlesource.com/c/92064
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-06 16:44:45 +00:00