Commit Graph

7128 Commits

Author SHA1 Message Date
Konstantin Shcheglov a1226b1490 Write and read almost all nodes.
CommentReference is not done yet.

Also skipped deprecated:
  visitListLiteral2
  visitMapLiteral2
  visitSetLiteral2

And about to be deprecated?
  visitForEachStatement
  visitForStatement
  visitMapLiteral
  visitSetLiteral


  Now we can resolve, write and read back into AST everything in pkg/.
  Some statistics:

R=brianwilkerson@google.com, paulberry@google.com

totalContent: 34814665 characters
totalWriteTime: 18140 ms
totalWriteBytes: 305675628
totalReadTime: 2761 ms
Change-Id: I2f92bb47c124d5ba040d8f66f762d23603c17609
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95580
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-06 17:20:49 +00:00
Paul Berry ba5644b76c Fix handling of closures containing type promotions in variables with inferred types.
Promotion analysis requires the localVariableInfo data structures to
be set; these are set by the VariableResolverVisitor.  So we need to
ensure that this visitor runs prior to type inference.

Change-Id: I579301beb101f32a1965f9eb8f07b1196d232b8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95422
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-06 17:16:19 +00:00
Paul Berry 4a7f9d7c11 Remove FindNode.setLiteral method.
I accidentally left this out of 47b417c88e.

Change-Id: Ife4f3e1ceb82417ab7b9246dc4d6d36020e963c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95486
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-05 23:33:24 +00:00
Paul Berry 47b417c88e Remove FindNode methods related to AST data structures that will be removed.
ForStatement and ForEachStatement will be removed in favor of
ForStatement2.  MapLiteral and SetLiteral will be removed in favor of
SetOrMapLiteral.  This CL changes FindNode methods to match, and
adjusts callers.

Change-Id: I89990f63aa277acd31458d485e897ebf0c6cf61f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-05 20:39:41 +00:00
Konstantin Shcheglov 927e758e96 Stop using package:html in analyzer.
Related to https://github.com/dart-lang/sdk/issues/35802

R=brianwilkerson@google.com

Change-Id: I875a8dc657900137c5a7b59f2820b30a81b23405
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95480
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-05 18:36:41 +00:00
Dan Rubel 58a0487125 more tests for 34610 and 36009
https://github.com/dart-lang/sdk/issues/34610
https://github.com/dart-lang/sdk/issues/36009

Change-Id: I840047fe53fe99b0e2c8b778a84b0598334ab295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95420
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-03-05 18:00:31 +00:00
danrubel 96e982f054 Improve await-outside-async error recovery
Fix https://github.com/dart-lang/sdk/issues/36048

Change-Id: If40baa44a0aefa301c042bc1002d92e577bd3b9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95302
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-05 17:08:31 +00:00
Dan Rubel e033b676dd fix parser crash in unterminated string literal inside unterminated interpolation
Fix https://github.com/dart-lang/sdk/issues/35900

Change-Id: I96d83e0c93d9e9c22d5b30048dc210672b1c003c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95043
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-03-05 15:35:58 +00:00
Brian Wilkerson 643895befc Fix two failing tests on the bots (TBR)
Change-Id: I607ae4c59b85e8720e1efbc1d60842168318d410
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-05 00:45:35 +00:00
Brian Wilkerson c86a9ece5f First cut at upward inference for the ui-as-code features
Change-Id: I5d63e9433deed3baa1a2df44e04b57782da6c9b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95062
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-04 22:00:46 +00:00
Mike Fairhurst a7a4c95df7 Summarize SetOrMapLiteral
Change-Id: Ic0356500fc9381a05bc91fb8bd9bead877de01cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94348
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
2019-03-04 21:47:21 +00:00
Paul Berry 1abcbe1318 Eliminate uses of old AST node types from parts of the analyzer
This CL covers the following subdirectories:
- pkg/analyzer/test/util
- pkg/analyzer/test/src/summary
- pkg/analyzer/test/src/dart/resolution
- pkg/analyzer/test/src/dart/ast
- pkg/analyzer/test/src/dart/analysis

Change-Id: I2a04f348906501ef99ba6a3162d04efcbb64c235
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95262
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-04 21:21:24 +00:00
Paul Berry 62df51cb34 Eliminate uses of old AST node types from parts of the analyzer
This CL covers the following subdirectories:
- pkg/analyzer/test/dart/element
- pkg/analyzer/test/generated

Change-Id: If550fef4c625efca7a295d59fbe08f6b5be4407f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95261
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-04 19:19:13 +00:00
Brian Wilkerson 1e0d514469 Address comments from a previous CL
Change-Id: I2a0ba9ae0b7c6b1e6e72de6fee5ac2bc7dfc5598
Reviewed-on: https://dart-review.googlesource.com/c/94987
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-03-02 15:59:12 +00:00
Jenny Messerly 5a335957f2 [analyzer] fix #33119, add strict-raw-types flag
When the flag is enabled, warnings are issued for raw types, for
example `List`.

Raw types (those without explicit type arguments) are allowed if any
of these are true, otherwise they are reported:

- none of the type arguments are `dynamic`.
- the type was inferred from a downwards context.
- the class/typedef has `@optionalTypeArgs` from package:meta.

Change-Id: I1e70dba5b3bf6118b274bbf72843e3578dbaa8fd
Reviewed-on: https://dart-review.googlesource.com/c/75629
Auto-Submit: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-03-02 00:02:01 +00:00
Paul Berry 5f9bd87689 Eliminate uses of old AST node types from parts of the analyzer
This CL covers the following subdirectories:
- pkg/analyzer/lib/src/dart/resolver
- pkg/analyzer/lib/src/dart/element

Change-Id: I3b20573b31b933936d1b541e7055ff21d2282288
Reviewed-on: https://dart-review.googlesource.com/c/94988
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-01 22:43:31 +00:00
Konstantin Shcheglov 298866ed94 Write / read resolved AST to / from flat buffers.
AstBinaryWriter does not yet support all node types, but a lot of them,
and can successfully write many large Dart files, including itself.
Whether it does it correctly, we cannot say yet, because AstBinaryReader
supports much smaller set of node types. I plan to add all nodes in
following CLs, and run over larger bodies of code.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Iaa2a5c743bd1659ea30c93632028d3a475736bf5
Reviewed-on: https://dart-review.googlesource.com/c/94684
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-01 19:48:02 +00:00
Brian Wilkerson f00fe7a289 Rework of downward inference for the ui-as-code features
Change-Id: Idfc815d976343a6ad015beaa6074ca5c979f8c3b
Reviewed-on: https://dart-review.googlesource.com/c/94700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-03-01 19:23:36 +00:00
Paul Berry 644026da51 Eliminate uses of old AST node types from AstFactory
Change-Id: I6bfb37b9a1e1477a27e5a60ba6120876ae5ecb9d
Reviewed-on: https://dart-review.googlesource.com/c/94804
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-01 18:03:25 +00:00
Mike Fairhurst 15515d86e3 Reland "[analyzer] Constant verifier support for SetOrMapLiteral"
Original change's description:
> Revert "[analyzer] Constant verifier support for SetOrMapLiteral"
> 
> This reverts commit 9c6315c199.
> 
> Reason for revert: Do not have permission to approve the bot failures.
> 
> Original change's description:
> > [analyzer] Constant verifier support for SetOrMapLiteral
> > 
> > Change-Id: Iaa189aa7ad733af3f702546f1d7a379630b61aa7
> > Reviewed-on: https://dart-review.googlesource.com/c/94581
> > Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> > Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
> 
> TBR=paulberry@google.com,brianwilkerson@google.com,mfairhurst@google.com
> 
> Change-Id: Id7f48506994cc5b8de506f9830f12d794f186e21
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/94981
> Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>

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

Change-Id: I7e514b646c1c62532e6f19201db6ea3428cb96d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/95000
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-03-01 08:01:24 +00:00
Mike Fairhurst 9bec44d1e2 Revert "[analyzer] Constant verifier support for SetOrMapLiteral"
This reverts commit 9c6315c199.

Reason for revert: Do not have permission to approve the bot failures.

Original change's description:
> [analyzer] Constant verifier support for SetOrMapLiteral
> 
> Change-Id: Iaa189aa7ad733af3f702546f1d7a379630b61aa7
> Reviewed-on: https://dart-review.googlesource.com/c/94581
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Auto-Submit: Mike Fairhurst <mfairhurst@google.com>

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

Change-Id: Id7f48506994cc5b8de506f9830f12d794f186e21
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/94981
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-03-01 07:43:04 +00:00
Mike Fairhurst 9c6315c199 [analyzer] Constant verifier support for SetOrMapLiteral
Change-Id: Iaa189aa7ad733af3f702546f1d7a379630b61aa7
Reviewed-on: https://dart-review.googlesource.com/c/94581
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
2019-03-01 06:36:17 +00:00
Paul Berry a2eac98753 Merge HintCodeTest_Driver into HintCodeTest.
This is necessary because the internal code base considers a test file
to fail if it doesn't run any tests.

Alternative fixes considered:

- Put a dummy test in hint_code_test.dart
- Rename hint_code_test.dart to a name that doesn't end in _test.dart

Change-Id: I64fa2be7c76b4d2a85ee9b46ba1a1c21ae2903ae
Reviewed-on: https://dart-review.googlesource.com/c/94800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-28 17:50:09 +00:00
Dan Rubel d650c619e2 more postfix "!" non-null assert operator tests
Address comments in https://dart-review.googlesource.com/c/sdk/+/94580

Change-Id: I1a337f967753f0269ec23c37f0714b77ebe14d4b
Reviewed-on: https://dart-review.googlesource.com/c/94640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-27 22:02:10 +00:00
Dan Rubel 31993bf1b5 improve expression function body recovery
Fix https://github.com/dart-lang/sdk/issues/31182

Change-Id: Ied691b50665b4c59a273296f8e724464d52efff5
Reviewed-on: https://dart-review.googlesource.com/c/94582
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-27 20:19:08 +00:00
Dan Rubel 8f12d634fe add postfix "!" non-null assert operator
This updates the parser to support a new "!" postfix assert non-null
operator for NNBD experimentation in analyzer. All other CFE listeners
report an error as they always have... albet a slightly different error.

This also updates reportErrorIfNullableType to report experiment-not-enabled

Change-Id: I7751443fd5a7a2756e823f38c78120e9c2e3e075
Reviewed-on: https://dart-review.googlesource.com/c/94580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-27 19:20:22 +00:00
Sam Rawlins ffc1383918 Move tests of five more analyzer codes to diagnostics
Change-Id: Ieec95d8b8426d366ce2d9e911d02385842f13ee6
Reviewed-on: https://dart-review.googlesource.com/c/94468
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-27 19:12:17 +00:00
danrubel 7829012e61 add new ExperimentNotEnabled error code
Change-Id: I541015db1f200de3f3846d7bd231b1996f947c6e
Reviewed-on: https://dart-review.googlesource.com/c/94420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-27 15:40:17 +00:00
Sam Rawlins 9450c6d829 Move SUBTYPE_OF_SEALED_CLASS to own file, and DriverResolutionTest
Change-Id: I1c5372bba522f1c3c818a2a1eafb366794e4700a
Reviewed-on: https://dart-review.googlesource.com/c/93929
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-27 02:08:25 +00:00
Mike Fairhurst e94e797d7b Fix flow analysis test for ForStatement2
Change-Id: I4a5e444189c9f09c5a29b9ff2fde183879c7a083
Reviewed-on: https://dart-review.googlesource.com/c/94351
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-02-26 21:57:25 +00:00
Paul Berry cfac26e184 Deprecate Expression.precedence.
In analyzer version 0.36.0, its return type will be changed to
`Precedence`.  Clients that wish to prepare for the change can switch
to `Expression.precedence2`.

Change-Id: I9c82fba557c5e3870c498afdb0bb5de22ba38240
Reviewed-on: https://dart-review.googlesource.com/c/94353
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-26 21:07:44 +00:00
Mike Fairhurst 4abf59202d Fix ForLoop2 support in reference collector
Change-Id: I2e5d07de850382cbd1c56182ca7de7979f558693
Reviewed-on: https://dart-review.googlesource.com/c/94350
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-26 20:44:14 +00:00
Paul Berry 385be0cf31 Remove unused imports
Change-Id: I831c216c5cd804f339f21cf8a300f35f654ec407
Reviewed-on: https://dart-review.googlesource.com/c/94352
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-26 16:21:52 +00:00
Paul Berry 3dfa610694 Work around #35993 by allowing ints to be assigned to doubles in constants.
Change-Id: If206149593849ce8588975ac8ed4d1cd78ae70e8
Reviewed-on: https://dart-review.googlesource.com/c/94123
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-02-25 15:28:34 +00:00
Brian Wilkerson a481832df9 Add a failing test for recovery in typedef
Change-Id: I175b617c5fccef6895f6ff5072a578bf8a72204a
Reviewed-on: https://dart-review.googlesource.com/c/94141
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-24 23:34:53 +00:00
Paul Berry f0155931a9 Fix null reference exception in _constantValuesEqual
See #35908.

Change-Id: Icbbb28920447362407e53c45b816474d1ab9e280
Reviewed-on: https://dart-review.googlesource.com/c/94021
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-23 01:15:21 +00:00
Dan Rubel 272f58e543 Revise parser to generate handleLiteralSetOrMap
... and no longer generate handleLiteralSet or handleLiteralMap.
In addition, a new hasSetEntry parameter has been added to the
handleLiteralSetOrMap event generated by the parser to support
existing behavior. Once all listeners have implemented
unified collections and that feature is enabled by default,
the hasSetEntry parameter can be removed.

This is the third of several CLs updating the parser and its listeners
to conform to the unified collection spec:
https://github.com/dart-lang/language/pull/200

Change-Id: Ia305eab1f720658f357ac4102b0b0c8128d16997
Reviewed-on: https://dart-review.googlesource.com/c/93963
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-22 19:58:38 +00:00
Brian Wilkerson f97f759ef3 Update the implementation of for loops
Change-Id: I492e8ce5303713cca0c742deeb53f670ebd21f84
Reviewed-on: https://dart-review.googlesource.com/c/93849
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-21 21:23:19 +00:00
Dan Rubel bc53c4dcda Update AstBuilder unified collection parsing to reduce error messages
Change-Id: Ib1af352a7f957c775064eeaa946a401e1024c90d
Reviewed-on: https://dart-review.googlesource.com/c/93847
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-21 18:14:09 +00:00
Sam Rawlins 372537f1e4 Add first support for strict-inference as an analysis option.
The first code is HintCode.INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE:

```dart
var a;  // Hint: The type of v1 cannot be inferred without a type or initializer
dynamic b;  // OK
var c = 7;  // OK
```

This is currently only enabled via an analysis options file:

```yaml
analyzer:
  language:
    strict-inference: true
```

I could add it as a flag as well, but to start using this internally at Google,
we only need support in the analysis options file.

Bug: https://github.com/dart-lang/sdk/issues/33749
Change-Id: Id2a6afa7c3d724b44c20576c7f48869abcf4255c
Reviewed-on: https://dart-review.googlesource.com/c/93700
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-21 17:28:19 +00:00
Konstantin Shcheglov c49537e743 Support for 'double' fields in summaries.
We already can store List<double>, but not `double` itself.

The LinkedConstantValue data structure I'm working on will have a
field of type `double`, so I need to support in in the generator.

R=paulberry@google.com

Change-Id: Ic5aa3a9a7266afabe6c64214fd68097fbebda4e8
Reviewed-on: https://dart-review.googlesource.com/c/93820
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-21 17:06:49 +00:00
Brian Wilkerson 9cdc189280 Fix bugs in list literals and add some inference tests
Change-Id: Ia0921b6a7e4ae944587b85b4601cbe88c654c3b3
Reviewed-on: https://dart-review.googlesource.com/c/93821
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-21 13:44:29 +00:00
Mike Fairhurst 48a9eb87ba [analyzer] Add hint for unnecessary ?.
Change-Id: I7a8532d353b1840332b7583a1884e6487a7656bf
Reviewed-on: https://dart-review.googlesource.com/c/92381
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-20 22:35:49 +00:00
Mike Fairhurst ccb2e2d293 [analyzer] Report dead code for x ?? y where x is non-null
Change-Id: I2946c5c9b8136151895a458b8ff44da66c96671a
Reviewed-on: https://dart-review.googlesource.com/c/92384
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-20 22:33:09 +00:00
Paul Berry 7ebd02cdaa Work around for #35908.
As a temporary workaround, we ignore types when comparing default values for overrides.

See https://github.com/dart-lang/sdk/issues/35908 for a more detailed
explanation for why this is necessary.  Once summaries properly record
types of constant values, we will be able to revert this hack.

Change-Id: I04728231338274a088656a629e303c0f1745466d
Reviewed-on: https://dart-review.googlesource.com/c/93642
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-20 20:20:05 +00:00
danrubel 8b0dd94e11 Revise AstBuilder to generate the new set-or-map AST structure
This is the first of several CLs updating the parser and its listeners
to conform to the unified collection spec:
https://github.com/dart-lang/language/pull/200

Change-Id: I7750bc4b029f3963b2df77dab3630775ce921bba
Reviewed-on: https://dart-review.googlesource.com/c/93740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-02-20 19:49:45 +00:00
Konstantin Shcheglov 1699562dfc Remove unused AbstractSingleUnitTest.
R=brianwilkerson@google.com

Change-Id: Ia705957e91214f6972089c81e38b441a9f711817
Reviewed-on: https://dart-review.googlesource.com/c/93378
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-20 18:14:05 +00:00
Konstantin Shcheglov 45cb49108f Issue 3204. Include mixin(s) into top-level declaration for import Quick Fix.
R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/3204
Change-Id: Ia80fca430c9cbe710ccaf74b97a1b025634b85b1
Reviewed-on: https://dart-review.googlesource.com/c/93641
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-20 03:05:21 +00:00
Konstantin Shcheglov 1ed9a34513 Add defaultArgumentListString / defaultArgumentListTextRanges to Declaration.
R=brianwilkerson@google.com

Change-Id: I1ce920bf3373634674f12b6e710f702214335e83
Reviewed-on: https://dart-review.googlesource.com/c/93371
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-19 21:17:31 +00:00
Konstantin Shcheglov c9ef5be8d7 Issue 124524319. Improve getElementDeclaration to support invalid code with synthetic names.
R=brianwilkerson@google.com

Bug: https://buganizer.corp.google.com/issues/124524319
Change-Id: Ie80cc66d580aa1c84892df6f839480d6d0501210
Reviewed-on: https://dart-review.googlesource.com/c/93484
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-19 03:36:54 +00:00