Dan Rubel
d26c310a27
Rework parsing of local const declarations
...
Similar to earlier work that reworked parsing of variable declarations,
this CL reworks parsing of local constant declarations to use
TypeInfo rather than parseType. This simplifies and improves recovery,
and reduces the number of error messages in some recovery situations.
Change-Id: I32705bdba20a0cb7aee41c64510c4c2896a5ae68
Reviewed-on: https://dart-review.googlesource.com/47241
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-03-20 22:50:20 +00:00
Brian Wilkerson
0e764393f3
A few more Dart2 related fixes
...
Change-Id: If2503b93e11f0831787dfa21e5ae0abb74e9162f
Reviewed-on: https://dart-review.googlesource.com/47302
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-03-20 20:17:59 +00:00
Konstantin Shcheglov
965cb81c0f
Add AnalysisSessionHelper and move getClass() into it.
...
R=brianwilkerson@google.com
Change-Id: I5d1f121ff86d1eea75d6f79663394bb79305c4ca
Reviewed-on: https://dart-review.googlesource.com/47187
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-20 19:05:24 +00:00
danrubel
08d305bbd7
Inline modifiers into endTopLevelFields and endFields events
...
Change-Id: I9681e22ae96c43626558ff567cbf4a12117095fa
Reviewed-on: https://dart-review.googlesource.com/47240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-03-20 15:00:35 +00:00
Brian Wilkerson
efab00ce5c
Fix type issues caused by running with --preview-dart-2
...
Change-Id: I99758d562e0140095d8f539419da9a98a55e6132
Reviewed-on: https://dart-review.googlesource.com/46941
Reviewed-by: Peter von der Ahé <ahe@google.com >
Reviewed-by: Dan Rubel <danrubel@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-03-20 13:36:17 +00:00
Dan Rubel
adb9f8cc0b
Inline modifiers into beginClassDeclaration and beginNamedMixinApplication
...
Change-Id: I0d95029c203a77d4a9e9dc2d8f1b40bced7535c5
Reviewed-on: https://dart-review.googlesource.com/47186
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-03-20 13:28:17 +00:00
Dan Rubel
fd005e17bc
Rework parsing of local function declarations
...
This CL reworks parsing local variable and local function
declarations to improve recovery and error messages.
In addition, the fasta parser properly parses metadata
before a local function declaration.
Change-Id: Ia43c8bab3f3ce3b824390a4aa36d50b85f1ea9af
Reviewed-on: https://dart-review.googlesource.com/46952
Commit-Queue: Dan Rubel <danrubel@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-20 12:01:26 +00:00
Konstantin Shcheglov
ac322d0fb4
Move LibraryElement caching to AnalysisSession.
...
I need something similar for Extract Widget refactoring - get references
to some Flutter types, which are probably already available from the
resolved unit.
R=brianwilkerson@google.com
Change-Id: I8d9a9e6c35c9fe7ef8fba6547c560642f650d018
Reviewed-on: https://dart-review.googlesource.com/47184
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-19 22:26:47 +00:00
Dan Rubel
06949dc985
Inline modifiers into beginFactoryMethod event
...
Change-Id: Ibc1053126b020577625279f4fab0bcff71aa5d15
Reviewed-on: https://dart-review.googlesource.com/47182
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-03-19 22:04:37 +00:00
Konstantin Shcheglov
8eb9f3db80
Create new AnalysisSession instance on changes.
...
R=brianwilkerson@google.com
Change-Id: I98ec3e28eadc20076a22ae9ac5d872557e73c9ef
Reviewed-on: https://dart-review.googlesource.com/47181
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-19 21:01:38 +00:00
Dan Rubel
8fde515354
Inline modifiers into beginTopLevelMethod event
...
Change-Id: I40423fcd53dc6a374a1c5be280d1806c31f34a6d
Reviewed-on: https://dart-review.googlesource.com/47120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-03-19 20:20:37 +00:00
Konstantin Shcheglov
1d184ace7b
Fixes for packages:args deprecated uses.
...
Mostly addOption() -> addMultiOption().
Change-Id: Iab40059aab45a371e0def89fbdfcd08bd1487d47
Reviewed-on: https://dart-review.googlesource.com/47121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2018-03-19 20:15:37 +00:00
Brian Wilkerson
6856e70b2f
Disable unused tests
...
Change-Id: Ib5c50063215e282c2b28b2b2fc207a3d63f81413
Reviewed-on: https://dart-review.googlesource.com/47100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-03-19 18:00:26 +00:00
Konstantin Shcheglov
538dbb62d6
Don't expect type arguments for class type parameters of static methods.
...
R=brianwilkerson@google.com
Bug: https://github.com/dart-lang/sdk/issues/32396
Change-Id: I4b6b6804cfced4c6628198a7e99e0123f77c2108
Reviewed-on: https://dart-review.googlesource.com/46940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2018-03-19 17:03:15 +00:00
Brian Wilkerson
209809eee0
Changes to AST impl classes
...
Change-Id: I2889157892e4a9666d15c5346d0ea24fe8d9d7a0
Reviewed-on: https://dart-review.googlesource.com/47062
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-03-19 16:19:56 +00:00
Brian Wilkerson
1560f19844
Fixes to make analyzer preview-dart-2 safe, part 1 of many
...
Change-Id: I8f88168a1fab61b3d0d808b5d9e09e6391325302
Reviewed-on: https://dart-review.googlesource.com/46953
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-03-19 13:15:46 +00:00
Dan Rubel
b2dd274e08
Remove modifiers from local function event structures
...
This removes pushing and popping modifiers when parsing a local function
declaration since they cannot have modifiers.
Change-Id: Iabbc6bb050d7006d07d4ec5d2220947593d62fd6
Reviewed-on: https://dart-review.googlesource.com/46880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-03-16 16:05:07 +00:00
Brian Wilkerson
02ac20deb0
Fix bug in optional new/const support
...
Change-Id: I5798e3ea145f87fe34a996205e2903533179918f
Reviewed-on: https://dart-review.googlesource.com/46578
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-03-15 20:52:34 +00:00
Konstantin Shcheglov
c9cb9c6700
Infer type arguments in constructor redirections.
...
R=brianwilkerson@google.com
Bug: https://github.com/dart-lang/sdk/issues/30855
Change-Id: I05e9102fe7b7a304be6ac6dd4d59e11bdafee59c
Reviewed-on: https://dart-review.googlesource.com/46575
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-15 19:37:45 +00:00
Brian Wilkerson
e9cdb5d4a8
Convert more analyzer tests to pass under preview-dart-2
...
Change-Id: Id2c7069da725db2d2572507fb73b51f5ab574d8a
Reviewed-on: https://dart-review.googlesource.com/46571
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-03-15 17:25:54 +00:00
Brian Wilkerson
8819d9fe98
Update analyzer tests for preview-dart-2, part 1
...
Change-Id: I3440607f7b3892193e1d9883709a1b9d4a7463d9
Reviewed-on: https://dart-review.googlesource.com/46562
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-03-15 16:45:04 +00:00
Peter von der Ahé
4f2bdff90b
Rename Program to Component
...
Change-Id: I1a3cc03fba9783807fa637a9d42fdbad68ee7686
Reviewed-on: https://dart-review.googlesource.com/31040
Commit-Queue: Peter von der Ahé <ahe@google.com >
Reviewed-by: Kevin Millikin <kmillikin@google.com >
2018-03-15 12:22:23 +00:00
Dan Rubel
71e16622cd
Improve for statement errors and recovery
...
This CL updates fasta parsing of `for` statements
to detect additional errors and improve recovery.
The parser originally called parseType when parsing `for` statements
which committed the parser down a particular path
and limited the ability of the caller to gracefully recovery.
Now the parser calls computeType, which parses and caches
the type information, so that the caller has more opportunity
to recover gracefully.
Change-Id: I6296ffb1f75e77a87a7533bfca77dae18cfcf60d
Reviewed-on: https://dart-review.googlesource.com/46383
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-03-15 11:43:13 +00:00
Dan Rubel
55369c5ed6
Report error on "as void" and "is void"
...
Change-Id: I1835d2f2c9ff6a4eac21adb3cac3c03e1f613e00
Reviewed-on: https://dart-review.googlesource.com/46640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2018-03-15 11:42:53 +00:00
Konstantin Shcheglov
389ad7e93f
Issue 32114. Fix instantiating typedefs to bounds.
...
R=brianwilkerson@google.com
Bug: https://github.com/dart-lang/sdk/issues/32114
Change-Id: I215eafb6314fe265d4809ff6ed80e4a567365a4f
Reviewed-on: https://dart-review.googlesource.com/46381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-14 00:31:18 +00:00
Dmitry Stefantsov
8c82c3b5fe
Fix instantiate-to-bound algorithm implementation
...
Change-Id: Ia13867b0ffab9fab527d8dba6d4f10cc90c002c2
Reviewed-on: https://dart-review.googlesource.com/43061
Reviewed-by: Samir Jindel <sjindel@google.com >
Reviewed-by: Peter von der Ahé <ahe@google.com >
Reviewed-by: Erik Ernst <eernst@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
2018-03-13 19:18:34 +00:00
Devon Carew
5bc6d66bd9
fix a few --preview-dart-2 issues
...
Change-Id: Ib4bd63b826d8957cdd2db97e1d5311f52bcdf921
Reviewed-on: https://dart-review.googlesource.com/46304
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Devon Carew <devoncarew@google.com >
2018-03-13 17:46:09 +00:00
Brian Wilkerson
ea94e65b43
Make preview-dart-2 imply strong-mode
...
Change-Id: Ifa230f9e64a538e222557ea471dc728ad3dd01d7
Reviewed-on: https://dart-review.googlesource.com/46300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Devon Carew <devoncarew@google.com >
2018-03-13 17:15:39 +00:00
Paul Berry
28cdeb3a49
Store method invocation arguments in summaries when needed for type inference.
...
When summarizing an initializer expression that contains a method
call, we need to store the method arguments in case they are needed
for type inference. They might be needed if the method in question is
a generic method and no type arguments are provided at the call site.
Since we do serialization based on an unresolved AST, we can't tell if
the method in question is generic at serialization time, so we
serialize the arguments of any method invocation that doesn't specify
explicit type arguments.
Addresses one of the root causes of #32394
Change-Id: Ibb50bdfc5ed29a518f51b13d2ffd72c484ab461d
Reviewed-on: https://dart-review.googlesource.com/46301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2018-03-13 16:03:59 +00:00
Brian Wilkerson
f1586f3bca
Remove the unused type parameter from ResultCachingPolicy
...
Change-Id: I858eaf7365d668bcb19ea35f6d0bbdee4b42897c
Reviewed-on: https://dart-review.googlesource.com/46160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-03-13 15:30:09 +00:00
Mike Fairhurst
6f3b6bfb62
Do the rounds for new analyzer publish + fix analyzer_plugin.
...
I'm not sure -- I ticked analyzer to 0.32 from 0.31-alpha.
I think because of the new methods, this is the right call (though it
leaves us in the weird place where there was no stable publish of
0.31.2?)
Also not sure if I need to update any other downstream packages (args?
dart_style?). Seems like if so, those are all in other repos.
Change-Id: I512e6674549a99fdafe47f2138738463f4e66e37
Reviewed-on: https://dart-review.googlesource.com/46126
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Mike Fairhurst <mfairhurst@google.com >
2018-03-12 23:02:29 +00:00
pq
c7224d8187
Update .gitignore to new dart_tool pub cache
...
See: https://github.com/dart-lang/sdk/issues/32030
Change-Id: I8210b963cec3656544e57fe468a59bd236b3c591
Reviewed-on: https://dart-review.googlesource.com/46000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-12 22:44:51 +00:00
Konstantin Shcheglov
c0d69c365e
Include default constructor in getElementDeclarations().
...
We record actual empty name for such constructors.
The client has enough information - kind CONSTRUCTOR, and empty name,
to decide on presentation.
R=brianwilkerson@google.com
Bug: https://github.com/dart-lang/sdk/issues/32495
Change-Id: I7cfd09c1e012a7c5ee72f7bb32fb0f258aaff148
Reviewed-on: https://dart-review.googlesource.com/46004
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-12 18:38:29 +00:00
Konstantin Shcheglov
de6b837b5f
Support for function typed parameters in getElementDeclarations().
...
R=brianwilkerson@google.com
Bug: https://github.com/dart-lang/sdk/issues/29510
Change-Id: I2ae8f69cd265286537623eaa0bf15a62c35a5bb8
Reviewed-on: https://dart-review.googlesource.com/46003
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-12 17:40:58 +00:00
Konstantin Shcheglov
693390a776
Index and search implicit references to optional positional parameters.
...
R=brianwilkerson@google.com
Change-Id: Icf5f48118aeccbc137f125f9e730c9fe84200063
Reviewed-on: https://dart-review.googlesource.com/45922
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2018-03-09 23:23:49 +00:00
Konstantin Shcheglov
977f4c706f
Issue 32397. Fix for top-level inference and implicit creation.
...
R=brianwilkerson@google.com
Bug: https://github.com/dart-lang/sdk/issues/32397
Change-Id: Idec5867cfd0ac3e6c0f650afb7f282e66aea91ce
Reviewed-on: https://dart-review.googlesource.com/45880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-09 21:20:00 +00:00
Brian Wilkerson
528d9d2e1f
Do not hint when only a responsive asset exists (issue 32250)
...
Change-Id: I8dc5402bb6d4e20682b49fa653349f03da934afe
Reviewed-on: https://dart-review.googlesource.com/45841
Reviewed-by: Devon Carew <devoncarew@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-03-09 20:26:29 +00:00
Brian Wilkerson
5eb6d980b5
Do not hint when using a deprecated parameter in the defining function (issue 32468)
...
Change-Id: I71de5c121add7bca7faa0875573e27f17f672e44
Reviewed-on: https://dart-review.googlesource.com/45840
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2018-03-09 19:09:08 +00:00
Brian Wilkerson
602a8c2a7b
Clean up usage of deprecated constants
...
Change-Id: I9005ba6e94529e15d8f7b21322591f4a9dabec47
Reviewed-on: https://dart-review.googlesource.com/45763
Commit-Queue: William Hesse <whesse@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2018-03-09 01:02:49 +00:00
Konstantin Shcheglov
eea08cfabe
Add optional 'file' for getElementDeclarations.
...
R=brianwilkerson@google.com
Bug: https://github.com/dart-lang/sdk/issues/32461
Change-Id: I0fa5ab2165e24f5b17ecc20ad8f97471389c8b8f
Reviewed-on: https://dart-review.googlesource.com/45761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2018-03-08 19:10:47 +00:00
Dan Rubel
83c8c21abe
Gracefully handle local function modifiers
...
Change-Id: I23f5ab9c9aaaee595ab6c552a6dddf9522ee17cd
Reviewed-on: https://dart-review.googlesource.com/45400
Commit-Queue: Dan Rubel <danrubel@google.com >
Reviewed-by: Peter von der Ahé <ahe@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-07 12:47:31 +00:00
Leaf Petersen
7fe8bdb2ee
Refactor tests
...
Change-Id: I29caa5421d9a2d25726aaaf676fd319b595dde7f
Reviewed-on: https://dart-review.googlesource.com/44880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-07 01:57:31 +00:00
Brian Wilkerson
69f8d4ef0d
Fix parsing of super expressions (issue 32393)
...
Change-Id: I887288254eb1be33c111b6dedd16c2acd3eb3dd1
Reviewed-on: https://dart-review.googlesource.com/45440
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: William Hesse <whesse@google.com >
2018-03-07 00:43:21 +00:00
Paul Berry
b5b8080b2c
Disable the conflicting generics check when using the old task model.
...
This is necessary since the old task model doesn't implement mixin
type inference properly.
Works around bug #32421 .
Change-Id: I6d7873d658d9d0fd8ea6aa5d2452bf9e92947032
Reviewed-on: https://dart-review.googlesource.com/45200
Reviewed-by: Alexander Aprelev <aam@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2018-03-06 14:14:54 +00:00
Mike Fairhurst
748cfdff7e
Refactor to efficiently find analysis roots correctly fix #31343 & #31344 .
...
Move logic out into a ContextCache since we're not interested in caching
at least two if not three things (the options, the options path, and
optionally the builder).
Move some convenience methods around accessing contexts into a mixin.
Regarding some semantic decisions for finding analysis roots:
* treat the analysis_options.yaml file as the analysis root if it exists
* if it doesn't exist, assume the directory passed in is the root
* if custom options are provided, assume they "overwrite" the others
_in-place_.
Tests to confirm this logic via excludes configurations with & without
the yaml file specified, passing in the root in some cases and
subdirectories in others.
Also change to use PathFinder for handling wildcards in excludes.
Bug: 31343,31344
Change-Id: I400fe30a1ec379f9040f812fc0bd9481d42a13cf
Reviewed-on: https://dart-review.googlesource.com/41570
Commit-Queue: Mike Fairhurst <mfairhurst@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2018-03-05 23:51:00 +00:00
Brian Wilkerson
1d159e7c23
Rename annotation testing methods in Element
...
Change-Id: I0f60b9abd3de350e62d89eac0d690a1db40316b7
Reviewed-on: https://dart-review.googlesource.com/45080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-03-05 17:23:48 +00:00
Brian Wilkerson
5fd560f96b
Add getters to replace ParameterKind
...
Change-Id: I0886c8d032e963857b8054e894ed3343a235b5c2
Reviewed-on: https://dart-review.googlesource.com/44921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2018-03-05 14:22:52 +00:00
Brian Wilkerson
0b332de3a8
Refactor where AST re-writing is happening to not interact poorly with inference (issue 32342)
...
Change-Id: Ia8c0d17cedb78709dce421658eb46ff6a80d56c5
Reviewed-on: https://dart-review.googlesource.com/44384
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2018-03-05 14:22:02 +00:00
Paul Berry
2993476129
Report an error if a class inconsistently implements a generic interface.
...
This is not allowed in Dart 2.0.
Change-Id: I6861ce298e5d5a5cf3f26a010990868b5ba9bda2
Reviewed-on: https://dart-review.googlesource.com/39601
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2018-03-05 12:13:12 +00:00
Paul Berry
11cbdbe26e
When checking mixin type inference errors, don't skip mixins with explicit type args.
...
Fixes #32372 .
Change-Id: I77bcdcdb5a764ba1d6075176800fa038aa46a1f9
Reviewed-on: https://dart-review.googlesource.com/44440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2018-03-05 09:10:01 +00:00