Commit Graph

7628 Commits

Author SHA1 Message Date
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
Paul Berry 7d8ffe0daf Eliminate uses of old AST node types from pkg/analyzer/lib/src/test_utilities
Change-Id: I5cfa3aa36e97c2fcb0d3969f483c04763bbcc882
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-04 18:12:22 +00:00
Konstantin Shcheglov 2e463506b7 Read more nodes from serialized AST.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I1d271707fc8a7b8ea86a0051efe3429d689c70af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94992
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-04 17:44:41 +00:00
Paul Berry 819f44532c Eliminate uses of old AST node types from pkg/analyzer/lib/src/task/strong
Change-Id: I2e0dabfcf15a150b52a84be803057a0a9ebeec1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95201
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-04 17:28:01 +00:00
Paul Berry 095e651ff2 Eliminate uses of old AST node types from pkg/analyzer/lib/src/services
Change-Id: I5aefe213b22e9200aa2e3f24ae065ef9fc0f214c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-04 16:14:16 +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
Konstantin Shcheglov 156790474e Allocate fieldOffsets once, in computeFieldOffsets().
At this point we know exactly how many offsets we have, so we can
allocate it and avoid growing. This make writing large data structures
about 25% faster.

R=paulberry@google.com

Change-Id: I884b0e3633bb4ea19a41ef1ceefaf1b427d0389e
Reviewed-on: https://dart-review.googlesource.com/c/95044
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-02 03:20:51 +00:00
Konstantin Shcheglov 4bd3e4b561 Write more AST nodes to summary.
There are probably still some nodes missing, but with this we can
write resolved analyzer/lib/ and analysis_server/lib/.

Reading is still mostly unimplemented.

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

Change-Id: I3c2e8a61a1d0f3ce5fbe8307b52e2094bc96fcb1
Reviewed-on: https://dart-review.googlesource.com/c/95064
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-02 00:24:41 +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
Paul Berry 38d675287c Eliminate uses of old AST node types from parts of the analyzer
This CL covers the following subdirectories:
- pkg/analyzer/lib/src/dart/analysis/dependency
- pkg/analyzer/lib/src/dart/constant

Note that some uses of MapLiteral and SetLiteral remain in these
directories to support cloning of old AST data structures.

Change-Id: I825ee8923f9d1a5a937f83293370c2628d28f590
Reviewed-on: https://dart-review.googlesource.com/c/95042
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-01 22:35:11 +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
Konstantin Shcheglov 863f7df7aa Include debug info when dart:core is not resolved.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/35226
Change-Id: I3064e1f2affae9b6fdd34b3740882cd06f293cba
Reviewed-on: https://dart-review.googlesource.com/c/94983
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-01 19:25:00 +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
Konstantin Shcheglov 67366ed771 Support for @Variant and @VariantId in generator.
It also includes a sample how it looks in IDL and generated.
I will remove it before landing.

R=paulberry@google.com

Change-Id: I4c60b33e623cf9c55d46a8dd9624377e5a0f5053
Reviewed-on: https://dart-review.googlesource.com/c/94921
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-03-01 02:43:30 +00:00
Paul Berry c2e48195f0 Rename UiAsCodeVisitorMixin to UIAsCodeVisitorMixin
To conform to Dart style rules

Change-Id: I1cc7ef76d0d723725f6d0393ca6e2b7538fc2f3e
Reviewed-on: https://dart-review.googlesource.com/c/94900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-28 21:42:09 +00:00
Paul Berry 545ebe1741 Prepare to publish analyzer 0.35.3
This is needed so that we can publish a version of analyzer_plugin
that depends on it; also so that dartfmt work on "UI as code" features
can proceed.

Change-Id: I7647fd69fec28b9e788f89e915c14779815fcc02
Reviewed-on: https://dart-review.googlesource.com/c/94803
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-28 20:54:19 +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
Paul Berry 39f365f3b9 Sort declarations in parser.dart.
Change-Id: I000193878307686d52e5b02cd3e6cdaafed68959
Reviewed-on: https://dart-review.googlesource.com/c/94681
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-02-28 12:48:56 +00:00
Paul Berry 8af83b19d6 Sort declarations in ast_builder.dart.
No functional change.

Change-Id: If695a7437482aef1de7013aa404260f3602bdc93
Reviewed-on: https://dart-review.googlesource.com/c/94642
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-02-28 12:48:16 +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
Paul Berry a1349ac529 Remove childEntities and visitChildren from ForEachStatementImpl and ForStatementImpl.
This paves the way for replacing these data structures with
ForStatement2Impl, by making them expose the same set of child nodes
that ForStatement2Impl would.

This required some fixes in the implementations of completion and
refactoring, since they make assumptions about the relationships
between nodes and their children.

Change-Id: I35e2873fcee2c88215c51c5caa5318934fc2a1a8
Reviewed-on: https://dart-review.googlesource.com/c/94401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-27 21:41:00 +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
Brian Wilkerson 1c477ad3aa Refactor downward inference to improve recovery
Change-Id: I4e177e43fe83287b62092533786f5ab47e777008
Reviewed-on: https://dart-review.googlesource.com/c/94584
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-02-27 20:14:57 +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
Paul Berry b04cb2f5e7 Don't create instances of ForStatement2Impl yet.
Until clients have been updated so that they don't expect the types
ForStatement and ForEachStatement, we need to create the derived
classes ForStatementImpl and ForEachStatementImpl.

Change-Id: I4be6c79e082ac4f3f63f36a5cc541260a77d8bb1
Reviewed-on: https://dart-review.googlesource.com/c/94461
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-02-27 18:12:07 +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
Paul Berry 25aa35ef98 Convert ast.dart to triple-slash comment style
Change-Id: I07b6fca7f725390dc9761769726024762a977e12
Reviewed-on: https://dart-review.googlesource.com/c/94402
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-02-26 22:49: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 0374ba1698 Coalesce ForStatementBase with ForStatement2Impl.
We don't need both classes.

Change-Id: Id36a1f8c04bf1c50458dd2e18ecdb0e0a8a6f7d0
Reviewed-on: https://dart-review.googlesource.com/c/94363
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-26 21:50:34 +00:00
Paul Berry 4cd309316b Prepare visitors for UI-as-code rework.
The following AST node types will be deprecated soon:
- ForEachStatement (use ForStatement2 instead)
- ForStatement (use ForStatement2 instead)
- MapLiteral (use SetOrMapLiteral instead)
- SetLiteral (use SetOrMapLiteral instead)

To allow clients to stop implementing visit methods that accept these
AST node types, we add a default implementation of each corresponding
visit method to each of the analyzer's visitor base classes; these
default implementations forwards to the new visit method.

This frees clients to begin migrating their visitors to the new AST
node types.

Future CLs will deprecate, and later remove, the old AST node types.

Change-Id: I8d86b64ef0b131012f0a9959aa8940e0d8561485
Reviewed-on: https://dart-review.googlesource.com/c/94301
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
2019-02-26 21:49:24 +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
Paul Berry 9b55682a5c Prepare to publish analyzer 0.35.2
Change-Id: I532d805f26e453aec0a38f4ce5f9213f6acd0b95
Reviewed-on: https://dart-review.googlesource.com/c/94020
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-02-22 22:20:42 +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
Paul Berry 5aba7b7b85 Normalize expression precedence between analyzer and front_end.
Several places in the analyzer and the analysis server were using
hardcoded integers to represent precedence, rather than referring to
constants defined in the front_end.  This led to some subtle
off-by-one errors, because the old analyzer convention (prior to
integration with the front_end parser) used 0 to represent the lowest
precedence of an expression (and -1000 to represent the precedence of
non-expressions), whereas the front_end convention is for 1 to
represent the lowest precedence of an expression.  As far as I can
tell there was no user visible impact, but it made it very difficult
to reason about operator precedence.

This CL updates the analyzer and the analysis server so that they
don't hardcode any precedence values; instead they refer to named
constants in the front end.

In a follow-up CL I'll reduce some hardcoded precedence numbers in the
front end itself.

Change-Id: Id3869afeb83042cc7d6630a0a4a0533a07058736
Reviewed-on: https://dart-review.googlesource.com/c/93964
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-22 13:39:46 +00:00
pq ff265bb5ae remove dead default lint registration API
Change-Id: If900a670489c636b67c7866c18dfc220ba5f9877
Reviewed-on: https://dart-review.googlesource.com/c/93922
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-02-22 13:37:36 +00:00
Konstantin Shcheglov eff286becd Fix errors in mock SDK.
R=brianwilkerson@google.com

Change-Id: Ibb1beebaf6a2766a2fe6352868bd3464c9905f72
Reviewed-on: https://dart-review.googlesource.com/c/93927
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-21 23:55:33 +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