Commit Graph

23582 Commits

Author SHA1 Message Date
Brian Wilkerson 00ee3159e5 Convert interfaces to use implements not extends
Change-Id: Ia49fb8aefe7eb096ab8c8365a77337155c3c473a
Reviewed-on: https://dart-review.googlesource.com/c/92535
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-10 19:31:27 +00:00
Brian Wilkerson 0a2672453f Split out several more hint tests
Change-Id: I6483656ca2ac9c7cfa00249cf37ccbb78758ffb6
Reviewed-on: https://dart-review.googlesource.com/c/92533
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-10 18:51:22 +00:00
Konstantin Shcheglov a49f7f1d44 Remove FunctionTypeAlias in _isFunctionalParameter().
It is not a type, but a node.

R=brianwilkerson@google.com

Change-Id: I603e958dda3c2486285a57bc23f2fd37491105f4
Reviewed-on: https://dart-review.googlesource.com/c/92528
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-10 17:11:18 +00:00
Konstantin Shcheglov 5f2d651d94 Move FindElement to analyzer/src/test_utilities/.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I3f376728ffe7fa49f50b8265359d637fca07ca57
Reviewed-on: https://dart-review.googlesource.com/c/92530
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-10 16:44:38 +00:00
Paul Berry 7cec1b03b6 Add missing awaits to migration tests.
Change-Id: Id7f4d5f063ba7253f5e8bd7abcf60a53fe7538af
Reviewed-on: https://dart-review.googlesource.com/c/92529
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-10 03:27:49 +00:00
Paul Berry b3ee960092 Stop indirecting through VariableRecorder/VariableRepostitory to create constraint variables.
The indirection wasn't adding any value.

Change-Id: I1c1b41a55b5cee37f75c30c3fa6ebfe56083ed56
Reviewed-on: https://dart-review.googlesource.com/c/92526
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-10 01:45:20 +00:00
Mike Fairhurst 5f79c9f4d1 Move UNCHECKED_NULL to error verifier.
Main risk in this CL is that it deviates from the void work which I'm confident is exhaustive.

Particularly, operators on void are caught by the resolver as a special kind of missing method, hopefully I put all the syntactic checks in at all the necessary places.

I also hardcoded "toString()," "hashCode." I previously had hardcoded to allow "==" checks, however, the code in ErrorVerifier was tripping over that. So now it should be good.


Change-Id: I56abb0219feb7aa143159694b688be15ba29015c
Reviewed-on: https://dart-review.googlesource.com/c/92063
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-09 23:26:49 +00:00
Konstantin Shcheglov 090ba0a520 Fix FUNCTION_TYPE_ALIAS test, provide the name for the named parameter.
R=brianwilkerson@google.com

Change-Id: Ief40a5d51d40f254b7398d679197fc5a9912c657
Reviewed-on: https://dart-review.googlesource.com/c/92524
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-09 22:26:59 +00:00
Konstantin Shcheglov d5038fc976 Stop using FileContentOverlay in RuntimeCompletionComputer and AbstractContextTest.
RuntimeCompletionComputer still is not good to work with AnalysisSession,
but now does not use the deprecated API.

R=brianwilkerson@google.com

Change-Id: I07f5e496c6f268c4d213ebb3794fa214b437f21e
Reviewed-on: https://dart-review.googlesource.com/c/92525
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-09 22:26:19 +00:00
Paul Berry ad3adb6285 Move nullability migration algorithm into analysis server.
Change-Id: Ie240b42cab37e3f5adce8633d368fcf6667b3a37
Reviewed-on: https://dart-review.googlesource.com/c/92522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-09 19:01:14 +00:00
Paul Berry 9103baf31c Move find_node into test_utilities so that it can be re-used in analysis server tests.
Change-Id: I9a302944ccc96b04a64508cc1f71498056f150bf
Reviewed-on: https://dart-review.googlesource.com/c/92521
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-09 19:01:14 +00:00
Brian Wilkerson 5787f08619 Clean up some hints in server and analyzer
Change-Id: Ia6bb5e4e4e398dbed29fe6649c490a88d4e0a406
Reviewed-on: https://dart-review.googlesource.com/c/92523
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-09 17:58:44 +00:00
Konstantin Shcheglov 5f3ed76854 Issue 3172. When adding a required argument, create a linked group for the default value.
R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/3172
Change-Id: I991b7d6a1094691d2a005786cb5bbc507a1004c9
Reviewed-on: https://dart-review.googlesource.com/c/92520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-09 17:30:35 +00:00
Konstantin Shcheglov 6f6bed94fd Replace TypeMatcher with isXyzElement.
R=brianwilkerson@google.com

Change-Id: Ibe6d4aa5c5c5e1b692fb527fcd0347a84783b19d
Reviewed-on: https://dart-review.googlesource.com/c/92444
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 23:39:48 +00:00
pq 18b5d66966 pass analysis options to linter contexts
Adds an analysis options backpointer to linter contexts.  With this, lint rules can
query options and conditionally support enabled language experiments.



Change-Id: I35dbfd112ed5f149dcc17b17b2edaf7420b38090
Reviewed-on: https://dart-review.googlesource.com/c/92460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-02-08 23:38:58 +00:00
Konstantin Shcheglov 2bab9eab49 Guard against empty URIs.
Particularly, against empty `part` URIs, because this would cause us
to think that the library includes a part, which URI is... the library
itself, because `resolveUri(uri, '') === uri`.

R=brianwilkerson@google.com

Change-Id: Ie6bf0279c467b00d9b5540697e866d0e619d49b0
Reviewed-on: https://dart-review.googlesource.com/c/92443
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 23:07:50 +00:00
Konstantin Shcheglov e6bc1d317a Break AvailableDeclarationsTest into several test classes.
R=brianwilkerson@google.com

Change-Id: I987fb062853beb61a54cfd9dafb10e175142d93f
Reviewed-on: https://dart-review.googlesource.com/c/92442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 21:21:06 +00:00
Konstantin Shcheglov 61ae86bce2 Add relevance tags to available declarations.
R=brianwilkerson@google.com

Change-Id: Ifa0fef7f9e572368c857fe972e007483782f119e
Reviewed-on: https://dart-review.googlesource.com/c/92405
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 19:56:36 +00:00
Konstantin Shcheglov 6b0baad623 Track definitely nullable and non-nullable variables.
This CL also contains changes from another CL.
Add missing generics in FlowAnalysis.
I can wait until that CL lands, and rebase, if it helps.

This CL also switches to a different approach to handle try / finally,
using two parallel states instead of 'restrict'.

R=paulberry@google.com

Change-Id: I1ca5bed3b4362cb3bdca5abf36c849c59538e57e
Reviewed-on: https://dart-review.googlesource.com/c/92246
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 19:54:16 +00:00
Konstantin Shcheglov 67c5923cce Enhance protocol to allow changing relevance of individual suggesions.
R=brianwilkerson@google.com

Change-Id: I3f3d256fcdc4d41c527bbc03fb71800583a264f7
Reviewed-on: https://dart-review.googlesource.com/c/92382
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ari Aye <ariaye@google.com>
2019-02-08 19:25:05 +00:00
Paul Berry afe37d7fe0 Add migration support for named parameters (with and without default values).
At this point the migration tool is beginning to make assumptions
about decisions the language team hasn't made yet, so I've created a
class to document those assumptions and allow us to test variants.

Change-Id: I4638d7f534cfa2dbd8460277351045c370377ff8
Reviewed-on: https://dart-review.googlesource.com/c/92394
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-08 17:47:55 +00:00
Konstantin Shcheglov 69d0411768 Fix exception when completion is requested not in a Dart file.
R=brianwilkerson@google.com

Change-Id: I3b24631dd4dec7124b7be13cc0618c289985476c
Reviewed-on: https://dart-review.googlesource.com/c/92389
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-08 17:10:45 +00:00
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