Commit Graph

4276 Commits

Author SHA1 Message Date
Dan Rubel b3847560e4 Update AstBuilder to report interpolation in import conditional
Change-Id: If87831a138c14ef913f46b99b044c774d828ea08
Reviewed-on: https://dart-review.googlesource.com/44080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-27 23:29:07 +00:00
Paul Berry 6e94dd93bd Skip mixin inference code when analyzer is running in non-strong mode
This should fix broken analyzer buildbots.

Change-Id: Ibb3893bf58bc5c4c759499e8344a44722cbe0ca5
Reviewed-on: https://dart-review.googlesource.com/44020
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-27 20:24:48 +00:00
Mike Fairhurst 4e11d9f78b Infer void for operator[]= return in task mode so it works in DDC
Bug:  32241
Change-Id: Ia34a0e1fb558a4ea4a939603c75c8176c1a04fb2
Reviewed-on: https://dart-review.googlesource.com/43889
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-27 17:52:39 +00:00
Paul Berry 593273cf51 Finish implementing mixin type inference in the analyzer.
Fixes #32146.

Change-Id: Ia46b6a54757901681858e682bdd6f809c194999c
Reviewed-on: https://dart-review.googlesource.com/43944
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-27 17:49:59 +00:00
Dan Rubel 6f710ee546 Update AstBuilder to report scanner errors
Change-Id: I7b33a86378a7c816ccdfb1a7e0869ccd5c3b8f7c
Reviewed-on: https://dart-review.googlesource.com/43900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-27 17:20:58 +00:00
Brian Wilkerson 73eb8a37e0 Make ContextRoot part of the API to support the angular plugin, fix some bugs
Change-Id: I3f23d1712473c4e5522c441ac31e013516ae5f4d
Reviewed-on: https://dart-review.googlesource.com/43880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-27 15:37:19 +00:00
Konstantin Shcheglov 75858ec680 Add optional 'parameters' field to ElementDeclaration.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/29510
Change-Id: I6b8e4417e7a7bc32537fdcbaa8fd04caf18da052
Reviewed-on: https://dart-review.googlesource.com/43885
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-27 01:27:37 +00:00
Konstantin Shcheglov 199206a735 Implement support for 'pattern' and 'maxResults' in getEElementDeclarations().
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/29510
Change-Id: I38a53c44016d01e2012b2e20173e0ae07cc658e2
Reviewed-on: https://dart-review.googlesource.com/43883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-26 22:48:20 +00:00
Brian Wilkerson de88ea0994 No hint when no return from Future<void> and async method
Change-Id: Ic925509b1b262d54712f8e9d4bdd7e8df211ed5e
Reviewed-on: https://dart-review.googlesource.com/43882
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-26 22:14:47 +00:00
Konstantin Shcheglov 586c183904 Add code range to ElementDeclaration.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/29510
Change-Id: I6e7afe3b8ea8191d737c717b753d55d2a7945a81
Reviewed-on: https://dart-review.googlesource.com/43840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-26 20:37:44 +00:00
Dan Rubel 76cd43ab02 Update fasta parser listeners to generate additional errors
This updates the AstBuilder and OutlineBuilder
to generate the following errors:

* ConstConstructorWithBody
* ConstMethod
* ConstructorWithReturnType
* FieldInitializerOutsideConstructor

In order to get the necessary state in OutlineBuilder so that I could
report these errors, I extracted SourceLibraryBuilder.addConstructor
from addProcedure.

In addition, I updated AstBuilder to use handleRecoverableError
rather than parser.reportRecoverableError.

Change-Id: I8b5517ec2ab44ff13a65628c594f803138cad6f5
Reviewed-on: https://dart-review.googlesource.com/43800
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-26 19:48:25 +00:00
Dan Rubel a8be36f42a Report error on dynamic with type arguments
Change-Id: Ie95e1c1b0b23cb3a3b6d4b7b7561edc2765fdebb
Reviewed-on: https://dart-review.googlesource.com/43560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-23 21:49:07 +00:00
Dan Rubel a8bf40399f Update fasta parser to report error on static constructor
This refactors how modifiers are passed to listener so that the
OutlineBuilder can report a static constructor error.

* Remove handleModifier/s calls from parseMethod
* Pass name and modifiers in beginMethod event
* Update listeners to process method modifiers in beginMethod event
    * AstBuilder
    * NodeListener
    * OutlineBuilder
* Address comment in https://dart-review.googlesource.com/c/sdk/+/42800

Change-Id: Iabd4a18613c1814eb5a157df4acf60dd9060d5eb
Reviewed-on: https://dart-review.googlesource.com/43120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-23 13:18:46 +00:00
Paul Berry 619727ab6f Fix warning in resource_provider_mixin.dart
The warning was: "Element 'File' from SDK library 'io.dart' is
implicitly hidden by 'file_system.dart'."

Change-Id: Iddd41025c780d41385d1c357fa800d6a31b4aa18
Reviewed-on: https://dart-review.googlesource.com/42980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-22 15:25:24 +00:00
Jenny Messerly 12a3378a49 fix #27305, DDC's default help should be simple
This moves more options to verbose help (`-h -v`) similar to dart2js and VM.

Change-Id: I7d3d9525543e26e55c2d1853e8c32722784c41d4
Reviewed-on: https://dart-review.googlesource.com/42881
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-02-21 23:49:42 +00:00
Dan Rubel f008b41d6b Parse invalid top level blocks during recovery
* New handleInvalidTopLevelBlock event for analyzer recovery
* Extract parseInvalidBlock and override in diet parsers

This addresses comments in https://dart-review.googlesource.com/c/sdk/+/41100

Change-Id: Ia7a7cc490231f5569906e4ad54c451c3b92c1e6b
Reviewed-on: https://dart-review.googlesource.com/42800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-21 19:06:19 +00:00
Danny Tuppeny 23127d04b6 Fix test_ArgDefaults_function_with_required_named test on Windows
The changes in addSource are so that the driver gets the convertedPath
(newFile already converts).

The change in the test is to format a path for importing on Windows - it
seems that importing a file with an absolute path is a bit wonky on
Windows (I presume since this is testing imports it's using absolute
paths for a reason).

The helper in the Mixin is for doing the conversion from a Windows path
to an importable version of it (this has many questions to answer and
maybe already exists somewhere?).

See #32095.

Change-Id: Ifed137ac354f9d0527344020c719e0c3c81ccf3e
Reviewed-on: https://dart-review.googlesource.com/42681
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-21 18:49:19 +00:00
Kevin Millikin be30b62e3d Remove the Kernel type inference listener
We have decided to move to a different API for Fasta/Analyzer
integration, one that doesn't involve compiling to Kernel or observing
type inference.  The listener API will become broken, so let's just
remove it before that happens.

We lose the ability to trace type inference so let's restore that
ability next.  The analyzer's resolution storer is not used, but that
code has been left.  The resolution applier will no longer work
without the resolution storer, so those tests have been disabled.

Change-Id: If9ac5aba2d5de7788d8a65f7fa8410599e636d21
Reviewed-on: https://dart-review.googlesource.com/42400
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-02-21 16:28:07 +00:00
Brian Wilkerson ceaac966fc Proposed analyzer API
Change-Id: I075a92a5e7f8dbdc0bb4827091c48c83c6272e0b
Reviewed-on: https://dart-review.googlesource.com/42083
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-02-20 22:43:35 +00:00
Alexandre Ardhuin 3caa0f9fee more null-aware hints
This adds 2 new hints `NULL_AWARE_BEFORE_OPERATOR` and `NULL_AWARE_IN_LOGICAL_OPERATOR`.

The previous `NULL_AWARE_IN_CONDITION` hint didn't catch null-aware issues in assigments or expression statements with logical operators. `NULL_AWARE_IN_LOGICAL_OPERATOR` handles those cases.

`NULL_AWARE_BEFORE_OPERATOR` handle issue like `a?.b + c`.

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

GitOrigin-RevId: 8b20ec5f7ea7901b1d0889eaf54ad0660c6e3f76
Change-Id: I36ada68c13dd0e1dd2bfd829ae25ce3ba9c8f402
Reviewed-on: https://dart-review.googlesource.com/42360
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-20 21:48:35 +00:00
Danny Tuppeny 40e3f9addc Convert paths for mock SDK libraries to fix tests on Windows
The other lines on this method are calling `provider.convertPath` around their paths but these ones do not, which is causing almost all analysis server tests to fail on Windows (for me - I can't explain them not
failing builds). This causes the hard-coded paths like `/lib/core/core.dart` to be fixed up to `C:\lib\core\core.dart` which is what the server is looking for (because at the other end the paths *have* been fixed up).

See #32226.

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

GitOrigin-RevId: 1adeee23f8ac8efc8acf61caf5f769e4ec44c030
Change-Id: Id9bf195967db0912c6f4b67bd79d504e627b8aab
Reviewed-on: https://dart-review.googlesource.com/42300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-20 18:55:38 +00:00
Brian Wilkerson aa28852ada Fix implicit new/const computation (issue 32221)
Change-Id: I63fb1b0b681ed2579fc12113d1bd0c837ab3dab5
Reviewed-on: https://dart-review.googlesource.com/42341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-20 17:31:26 +00:00
Paul Berry 4ac96941fc Relax checks in Resolution Applier
If the BodyBuilder assigns a location to an entity, but the analyzer
doesn't, don't regard that as an error.

This can happen, for instance, when the BodyBuilder creates a
synthetic `null` to refer to the default value of an optional
parameter.  For better debuggability, it makes sense for the
BodyBuilder to assign a location for that synthetic `null`, but there
is no corresponding analyzer token.

Change-Id: I91bb77bfe900a834353bf90482932321fecde416
Reviewed-on: https://dart-review.googlesource.com/42200
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-19 11:38:08 +00:00
Konstantin Shcheglov 00225dedfe Implement Search.declarations().
R=brianwilkerson@google.com

Change-Id: Id14cf6c1f4cbf51fa8398d257515b96ee3b0d4a6
Reviewed-on: https://dart-review.googlesource.com/42181
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-19 00:06:32 +00:00
Leaf Petersen 3d6ad7b3a2 Remove fuzzy arrows except on assignability
Change-Id: I00ffa8f6f85cede8badd4d7082da4603f998956c
Reviewed-on: https://dart-review.googlesource.com/40470
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-02-17 00:30:56 +00:00
Konstantin Shcheglov 188697d6e1 Resolve arguments to parameter in implicit instance creations.
R=brianwilkerson@google.com

Change-Id: I492342c6e501df187d34c43542683f1091f81f58
Reviewed-on: https://dart-review.googlesource.com/42102
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-16 21:31:27 +00:00
Konstantin Shcheglov dcefeb17b6 Set ClassElement implicit instance creation.
I also changed tests to be a bit more specific - test whether elements
are class and constructor where one is expected. Not found additional
problems though.

R=brianwilkerson@google.com

Change-Id: I95cf57e46620149740d6c748a6065b3b2e00409e
Reviewed-on: https://dart-review.googlesource.com/42027
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-16 19:49:57 +00:00
Konstantin Shcheglov 6e912ff3ed Don't cast to LibraryElementImpl.
Also run PreviewDart2Test with analysis driver, that's how it is actually
used.

R=brianwilkerson@google.com

Change-Id: I6757d7435c376a07fa1ef00b495b5fab0d118924
Reviewed-on: https://dart-review.googlesource.com/42023
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-16 18:17:07 +00:00
Konstantin Shcheglov 670c288711 Issue 32162. Fix for crash in generic function type argument of unresolved class.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/32162
Change-Id: I0a2df5bf5a08b52a7eb47e1b8265b9bbbf65e599
Reviewed-on: https://dart-review.googlesource.com/41922
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-16 01:01:16 +00:00
Mike Fairhurst 470f28e3c6 Fix #31345 include analysis_options breaks some properties
Bug: 31345
Change-Id: I8d588cc49931ccb4699cc33c8e12a7f701a0a513
Reviewed-on: https://dart-review.googlesource.com/41500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-14 21:32:44 +00:00
Dan Rubel dd0a08a75e Improve fasta parser error reporting
This CL updates the fasta parser to report more errors
and have improved recovery. The new errors reported include:

* IllegalAssignmentToNonAssignable
* MissingAssignableSelector
* StaticConstructor

In addition, a number of test expectations were updated
to match the errors already produced by the fasta parser.

Change-Id: I99889e8e64663ca5b81a5d5d8f5e5241d049a0a2
Reviewed-on: https://dart-review.googlesource.com/41100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-14 18:01:14 +00:00
Brian Wilkerson a83bcc8235 Check for unresolved imports too avoid breaking when handling optional new and const (issue 32150)
Change-Id: Ia7cc162e0e615ce324acb230e1d0bbf59d89ffa1
Reviewed-on: https://dart-review.googlesource.com/41380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-14 17:42:13 +00:00
Brian Wilkerson 75a2a1524f Support updated optional new and const spec
Change-Id: I974185eba4936f14d7b9d5d1d5c1638a37624c62
Reviewed-on: https://dart-review.googlesource.com/41024
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-02-14 17:12:13 +00:00
Paul Berry 421db9c69c Re-land "Implement proper checking for callability of Function class."
(was reverted in https://dart-review.googlesource.com/c/sdk/+/40980
due to an analyzer bot breakage)

Original commit message:
Implement proper checking for callability of Function class.

There was some old (incorrect) logic for doing this, behind the flag
enableStrictCallChecks.  This flag has been removed, since the new
behavior is now standard in Dart 2.0.

Fixes #31509

Change-Id: Ice5cf38bbc648badf7f2563ff930b69f9a799635
Reviewed-on: https://dart-review.googlesource.com/41120
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-14 11:30:23 +00:00
Paul Berry 35aea15097 Revert "Implement proper checking for callability of Function class."
This reverts commit 6837dafcc3.

Reason for revert: Broke analyzer bots.

Original change's description:
> Implement proper checking for callability of Function class.
> 
> There was some old (incorrect) logic for doing this, behind the flag
> enableStrictCallChecks.  This flag has been removed, since the new
> behavior is now standard in Dart 2.0.
> 
> Fixes #31509
> 
> Change-Id: I4a6da34a4b85ea8409f6e0d14c377a586546056a
> Reviewed-on: https://dart-review.googlesource.com/40509
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Mike Fairhurst <mfairhurst@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com,mfairhurst@google.com

Change-Id: Ib631ad16bc5e937ff914127d1c5330f3fcaff2c9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/40980
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-13 19:56:35 +00:00
Paul Berry 6837dafcc3 Implement proper checking for callability of Function class.
There was some old (incorrect) logic for doing this, behind the flag
enableStrictCallChecks.  This flag has been removed, since the new
behavior is now standard in Dart 2.0.

Fixes #31509

Change-Id: I4a6da34a4b85ea8409f6e0d14c377a586546056a
Reviewed-on: https://dart-review.googlesource.com/40509
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2018-02-13 14:19:08 +00:00
Mike Fairhurst 7a0a9284ba Relax void errors: no error assigning void to void variable (+tests)
Change-Id: I1a6e80125dff6f766c9a74b760b557609a2544fb
Reviewed-on: https://dart-review.googlesource.com/40507
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-12 21:24:19 +00:00
Konstantin Shcheglov 3791ddb496 Keep unresolved import/export directives for task based analysis.
Bug: https://github.com/dart-lang/angular/issues/801
Change-Id: If8bdcbfdc10d3aae914391573c5eb2e7beb26a8f
Reviewed-on: https://dart-review.googlesource.com/40600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-02-12 21:20:49 +00:00
Paul Berry a895c9b283 Promote TOP_LEVEL_CYCLE to an error
Top level type inference cycles constitute a compile-time error in
Dart 2.0.

Change-Id: I8663ea126fec2a4f495ee77125e9145372855934
Reviewed-on: https://dart-review.googlesource.com/40260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-12 11:04:48 +00:00
Mike Fairhurst 56d59dd967 Reland https://dart-review.googlesource.com/c/sdk/+/37441 with fixes
Change-Id: If8e2ec2ca1ac4f533dcb56b0c95d55e4a13e0598
Reviewed-on: https://dart-review.googlesource.com/39881
Reviewed-by: Paul Berry <paulberry@google.com>
2018-02-08 20:46:19 +00:00
Dan Rubel d4f2f9cef2 Update fasta parser to report constructor initializer errors
This CL updates the fasta parser to report three additional
errors in constructor initializers:

* ExpectedAnInitializer
* MissingAssignmentInInitializer
* RedirectingConstructorWithBody

I also added a comment from a discussion about
https://dart-review.googlesource.com/c/sdk/+/39320

Change-Id: Iecb6fe97e3612a11ccc89864a4fc9f353846504c
Reviewed-on: https://dart-review.googlesource.com/40040
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-08 18:08:40 +00:00
Paul Berry 2f8b0ff200 Remove unused import
Change-Id: I60a43113afcff04eedf3cab44223ce180fd77e97
Reviewed-on: https://dart-review.googlesource.com/39902
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-08 15:52:11 +00:00
Mike Fairhurst ec58f5646a Revert "Make void a static warning to use almost everywhere."
This reverts commit 09eed74a8a.

Reason for revert: Too much SDK code is not yet compliant.

Original change's description:
> Make `void` a static warning to use almost everywhere.
> 
> Changed the hint to a StaticWarningCode, since that's the new spec'd
> error type and the hint is no longer needed.
> 
> Added a new set of methods to test the cases.
> 
> Didn't try to solve the problem generally ("all usages except ... are
> errors" means it easier, in theory, to make a ReportVoidExpressions
> style visitor that catches absolutely all types) because most of the
> work is actually about suppressing errors that are no longer needed.
> Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
> put the void handling logic into each AST method specially anyway.
> 
> Some redundant tests removed.
> 
> Don't flag: ternaries, void -> void assignments, void returns in
> dynamic.
> 
> Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
> Reviewed-on: https://dart-review.googlesource.com/37441
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=leafp@google.com,scheglov@google.com,mfairhurst@google.com

Change-Id: I13ee4c6939468d35506779ade637a040833632f4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/39848
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-07 22:32:51 +00:00
Mike Fairhurst 09eed74a8a Make void a static warning to use almost everywhere.
Changed the hint to a StaticWarningCode, since that's the new spec'd
error type and the hint is no longer needed.

Added a new set of methods to test the cases.

Didn't try to solve the problem generally ("all usages except ... are
errors" means it easier, in theory, to make a ReportVoidExpressions
style visitor that catches absolutely all types) because most of the
work is actually about suppressing errors that are no longer needed.
Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
put the void handling logic into each AST method specially anyway.

Some redundant tests removed.

Don't flag: ternaries, void -> void assignments, void returns in
dynamic.

Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
Reviewed-on: https://dart-review.googlesource.com/37441
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-07 21:36:01 +00:00
Brian Wilkerson 217110c2db Use TypedLiteralNode.isConst in more places and fix a bug to improve the optional new/const support
Change-Id: I2839b0c269796fedb7a3e7340388bb3576ac6b59
Reviewed-on: https://dart-review.googlesource.com/39424
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2018-02-07 17:00:51 +00:00
Paul Berry f299f2d00f Remove error code TOP_LEVEL_TYPE_ARGUMENTS, which is no longer used
Change-Id: Ic41373617a5c96906840ac49bc13825323b486c6
Reviewed-on: https://dart-review.googlesource.com/39560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-07 14:41:42 +00:00
Paul Berry d9d2dc405b Infer mixin types in the analyzer.
This follows Leaf's simplified suggestion.  As a temporary hack it
assumes that the mixin passes its type parameters through to its
superclass constraint unchanged.

Change-Id: I091b44005d6364a91e20578f2ff6340334b1fab6
Reviewed-on: https://dart-review.googlesource.com/38040
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-02-07 10:45:39 +00:00
Lasse R.H. Nielsen 6f78471687 New methods on Iterable, List, Set, Queue, Map.
Changes signature of Iterable.singleWhere.
Makes LinkedHashMap no longer be a HashMap.

Change-Id: I7a12fea533d42b0fc8357086649df38ad01f3cdd
Reviewed-on: https://dart-review.googlesource.com/39140
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-02-07 06:12:53 +00:00
Dan Rubel b2c5415db9 Rework parseClassMember to remove findMemberName
This CL finishes the process of removing findMemberName from parsing
class members and sets the stage for improved recovery.
In addition, this CL:

* Revises the `endMethod` event to include a beforeParam token
    so that the parser can revise the token stream before the parameters
    during recovery.

* Reworks insertSyntheticIdentifer for use in more places

Change-Id: If5bcd6f554053f72429e938b5cd5e7021e03d5b3
Reviewed-on: https://dart-review.googlesource.com/39320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-06 21:01:53 +00:00
Dan Rubel e1e7ab1c3d Fasta parser cleanup
This separates and cleans up externally called fasta parser methods
such as parseTopLevelMember and parseMember from internal callers.

* Split external and internal calls to parseTopLevelMember
    so that external callers use parseTopLevelMember
    and internal callers use parseTopLevelMemberImpl.

* Rename the externally called parseMember --> parseClassMember
    and the internally called parseClassMember --> parseClassMemberImpl

* Revise the insertSyntheticIdentifier method and cleanup some
    exiting recovery code to use it.

Change-Id: Ic66ddcbbe761937bb917c679590fc7de2fdd0396
Reviewed-on: https://dart-review.googlesource.com/39080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-06 16:34:43 +00:00