Commit Graph

7128 Commits

Author SHA1 Message Date
Konstantin Shcheglov 7418238239 Implement LibraryElementForLink.session and return (empty) AnalysisSessionForLink.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://buganizer.corp.google.com/issues/127956822
Change-Id: Ifc93882d9ae7ae6079497fb10f3feea7ac6fb9e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96864
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-14 15:39:18 +00:00
Konstantin Shcheglov eeb19b0416 Remove usages of ExtensionManager and package:plugin in general.
R=brianwilkerson@google.com

Change-Id: I489e72464474b3d40d7678f44562f65934f93288
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96863
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-14 15:31:08 +00:00
Konstantin Shcheglov d5ab8b4da2 Resolve ForElement(s) in separate scopes.
R=brianwilkerson@google.com, paulberry@google.com

Context: co19_2/LanguageFeatures/Control-flow-collections/dynamic_semantics_list_A04_t01
Change-Id: I09e63e0821015993aa47736efd729411a9bd67e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96833
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-14 01:11:26 +00:00
Brian Wilkerson 037b273753 Make List literal inference match the proposal
Change-Id: I8c70fc80d1965a407141c4d1c8e90f1d32bd44ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96847
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-14 00:16:56 +00:00
Mike Fairhurst 1bd7920367 Resolve generic function default parameter values
Change-Id: I060ee8f61b8cb74482b92d4057e4183f1e4ca269
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96701
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
2019-03-13 22:44:18 +00:00
Paul Berry 31c47567dc Remove AnalysisOptionsForLink and plumb analysis options through linker.
This is a non-breaking change; the only way linking is exposed to
clients is through `SummaryBuilder`, which can get the analysis
options from the context.

Fixes #35747.

Change-Id: I273408f33a881ac32ab248cbc8f3e0644630563b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96829
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-13 22:39:53 +00:00
Konstantin Shcheglov 078c834f25 Extract CONST_SET_ELEMENT_TYPE_IMPLEMENTS_EQUALS test and fix for spreads in sets.
R=brianwilkerson@google.com

Change-Id: I1667d6bdde78a35a542f2ec525d5328573322600
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96830
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-13 21:31:31 +00:00
Konstantin Shcheglov f08e213bb1 Extract CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS tests.
R=brianwilkerson@google.com

Change-Id: Ic73cdade894f4d5832427d193eaa0c33e51676b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96825
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-13 19:28:34 +00:00
Konstantin Shcheglov 2b00685d38 Make SetOrMapLiteral set/map unless we are linking, so going to infer it.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I676975b4fd861f37fcd58c48782f0a4fa59ce178
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96824
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-13 19:16:59 +00:00
Konstantin Shcheglov 81fa14eb3c Hollow out AnalysisContextImpl.
R=brianwilkerson@google.com

Change-Id: I4ebc67de74cc4bbda63c9f0a8f7c11dbc3f25b21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96720
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-13 15:18:22 +00:00
Brian Wilkerson 4a7556840f Rename tests ending with Test_Driver
Change-Id: I1b4822630a2508e8a41ba6c5564eae5a54f56622
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96740
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-13 13:38:22 +00:00
Konstantin Shcheglov 0a337bb36f Report CONST_SPREAD_EXPECTED_LIST_OR_SET and CONST_SPREAD_EXPECTED_MAP.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I70eb31a19c447d17b4cc60ae2ff3caadb35cc6bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96712
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-13 06:40:05 +00:00
Brian Wilkerson 16e40cef2f Generate a diagnostic when a set or map literal is ambiguous
Change-Id: Ia105468cf921ee2548ed48e286297e10f921a986
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96541
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-12 17:50:40 +00:00
Paul Berry ba3b9b3b65 Sort static_type_analyzer_test.dart
Change-Id: I4767ea98e947279d1af5d4295d1c8e66c02dee80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96660
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-12 14:59:42 +00:00
Konstantin Shcheglov 016e3172d1 Default parameters, more metadata, import dart:core.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ibf31dcc7e0fbea3935f75c7472a23eac4c2999eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96522
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-12 00:26:01 +00:00
Brian Wilkerson b87c44d6b3 Generate diagnostic for non-bool conditions in if elements
Change-Id: I36bd37a3a3bdfea7ca0853d90299b5fa7d36a352
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96520
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-11 21:51:31 +00:00
Konstantin Shcheglov 74395d940f Comment out test_import_short_absolute that fails on Windows.
TBR

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

Change-Id: Ic613b1c0f1acb5fc8cac0023cfd989b2dabccf0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96521
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-11 21:39:47 +00:00
Konstantin Shcheglov 15842d4583 Build more import scopes, support for enums.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I78c7a8be5b5d4ea9c9ecbc82f0c1101d7819dd30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-11 20:16:26 +00:00
Paul Berry f2029f54cd Fix type inference of map/set literals when the context is a type parameter.
Change-Id: Ic78cfd838e7fce4f362770c0827d71b351711e57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96340
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-11 19:48:26 +00:00
Brian Wilkerson bfb30bffe0 Fix a bug in the ConstantVerifier so that conditional elements are lazily verified
Change-Id: Ib8b8d5af3dc3a27280116d275616bf26a482bb90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96360
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-03-11 19:14:38 +00:00
Paul Berry abd1854176 Fix recording of map/literal context type.
Previously, we were using the storage space provided by
`InferenceContext.getContext` for two purposes: 1. to store the
inference context passed down from the parent AST node, and 2. to
store the refined inference context computed by
ResolverVisitor._computeContextType.  After type inference, the data
that remained was the refined interface context (2); however,
ErrorVerifier._checkForRawTypeErrors was expecting to be able to
retrieve the downward inference context in order to report
`HintCode.STRICT_RAW_TYPE` correctly.  This caused a failure in
test_strictRawTypes_emptyMap (in checker_test.dart).

This CL fixes the issue by storing the refined inference context (2)
in a field in `SetOrMapLiteralImpl`, so that it doesn't overwrite the
downward inference context (1).

It also fixes an issue that was previously obscured by this bug, where
we weren't copying over the downward inference context when replacing
a set literal with a map literal.  (This fix will become irrelevant
after the next breaking change release of the analyzer, when we stop
creating different objects for set vs. map literals, and simply use
the base class `SetOrMapLiteralImpl`).

In addition, ResolverVisitor._computeContextType has been renamed to
_computeSetOrMapLiteralContextType to clarify that it only computes
context information for set/map literals.

Change-Id: I62a9c4bb6fe755acf60b881948538216af81b515
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96261
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-11 16:50:43 +00:00
Konstantin Shcheglov a8b3461f2e New summaries work snapshot.
1. Extract LinkingBundleContext to store references and types.

2. Resolve and resynthesize metadata for many nodes.

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

Change-Id: I88334bd4509efe0182a4bba6a67edac99ed51886
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96262
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-11 15:21:32 +00:00
Paul Berry 9e7627b6a1 Re-land "Eliminate uses of old AST node types from pkg/analyzer/lib/src/summary"
There are two bug fixes:

- Due to dartbug.com/33441, it's possible that a set/map literal
  resynthesized from a summary will have neither its `isSet` or
  `isMap` boolean set to `true`.  We work around the problem for the
  short term assuming such literals are maps.

- The linker method ConstNode.collectDependencies hadn't been updated
  to handle the new summary nodes `makeUntypedSetOrMap` and
  `makeTypedMap2`.

This CL includes unit tests for these two bug fixes.

Original change description:

> Eliminate uses of old AST node types from pkg/analyzer/lib/src/summary
>
> Change-Id: Ida907040d0461d9ae723421eeac71f4e19a8d4b2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95284
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Bug:

Change-Id: Ie26be4e0e241872ef4c7e183ada1f1d6b5f6e7f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96264
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-11 14:43:22 +00:00
Konstantin Shcheglov fa90c9abe5 New summaries work snapshot.
1. Extract TokensWriter and TokensContext.

2. Type parameters for more declarations.

Change-Id: Iaeeaa5c8da98c9fa5dce65244ccb28e66d3656a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96224
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-10 17:06:28 +00:00
Konstantin Shcheglov 1335296750 Move SourceLibraryBuilder builder, support for typedef(s), some type parameters.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I5c78a165d9d4c60bb268dccd4ace47985d98529c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-09 17:24:06 +00:00
Paul Berry 9e5cf6b09e Improve set/map/list literal type checking.
We now exclusively use StaticWarningCode.*_TYPE_NOT_ASSIGNABLE to
report static errors.
CheckedModeCompileTimeErrorCode.*_TYPE_NOT_ASSIGNABLE is reserved for
future use when #21119 is fixed.

Change-Id: I681b1253417a135272361306cb3468dd9590b17b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96200
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-09 13:43:26 +00:00
Paul Berry affcca729b Fix some tests broken by CL 94993
Some of the "regressions" in CL 94993
(73be247e12) just turned out to be test
expectations that needed to be updated.  This CL makes the following
kinds of updates to test expectations:

- Adds info:INFERRED_TYPE_LITERAL when necessary (some of the code for
  inferring the types of type literals has been generalized, so this
  info is reported more frequently than it previously was).

- Removes duplicate error:*_TYPE_NOT_ASSIGNABLE (it was previously a
  bug to report this twice; that bug is now fixed).

Change-Id: I75a6ab3c420c2aa868ec8cb203e33f76a1e57a75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96201
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-09 00:13:06 +00:00
Paul Berry f6c8468a98 Revert "Eliminate uses of old AST node types from pkg/analyzer/lib/src/summary"
This reverts commit 0b40a46ab5.

Reason for revert: Broke flutter

Original change's description:
> Eliminate uses of old AST node types from pkg/analyzer/lib/src/summary
> 
> Change-Id: Ida907040d0461d9ae723421eeac71f4e19a8d4b2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95284
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

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

Change-Id: Ie13d23c84ea59c60acf56fd0d73f73c91107f6ed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96202
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-09 00:07:36 +00:00
Paul Berry 0b40a46ab5 Eliminate uses of old AST node types from pkg/analyzer/lib/src/summary
Change-Id: Ida907040d0461d9ae723421eeac71f4e19a8d4b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95284
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-08 23:22:45 +00:00
Konstantin Shcheglov 37fa71dc4e Resolve types in scopes, resynthesize some elements.
Also some very basic top-level inference: field formal initializers in
constructors, initializers of top-level variables (for now ignoring
dependencies), setter return type to `void`.

We pass 172 or 590 resynthesis tests, about 29%.

Change-Id: Id70b80ceb7c794627626a1fe94172b0e9ccdda8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95672
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-03-08 22:55:59 +00:00
Brian Wilkerson 04befc2ab3 Improve type inference tests
Change-Id: I8e95d906a7cf933720d7d9012f9a9b66064d0fe3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96129
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-03-08 21:17:35 +00:00
Paul Berry 73be247e12 Eliminate uses of old AST node types from pkg/analyzer/lib/src/generated
Change-Id: Icba5f914248124909e38091f846054de8924adc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94993
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-08 21:04:20 +00:00
Paul Berry 8430281a6b Add an implementation of ScopedVisitor.visitForEachPartsWithDeclaration.
Change-Id: I659609caa84e837801a0a38871c8bb8bb0c8948c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-08 18:58:58 +00:00
danrubel b2cb604b9d improve literal list/map/set control flow recovery
* new ExpectedElseOrComma parser error code
* update recovery tests to enable control flow recovery
* rework test to call parser.parseLiteralListSuffix rather than parser.parseLiteralListSuffix

Fix https://github.com/dart-lang/sdk/issues/36141

Change-Id: I5bdee19eb3828de8fbdc514a3820afaa1309df99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-03-08 17:31:33 +00:00
Brian Wilkerson 9a7679e9e1 Remove some of the tests of the task framework to reduce references to it
Change-Id: I1ec466bfbbcb9279169f6d076db72cece38dcd6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-08 16:03:23 +00:00
Brian Wilkerson 6e359857e4 Move ConstantEvaluationTarget out of the task model
Change-Id: I961f033e871a05ba38383b79865ed2795a1d452f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95984
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-08 16:03:03 +00:00
Paul Berry 0e054b1c6e Some fixes for UI-as-code type inference
Change-Id: I72711aad365e95f2f1b20d7f23d7765a9581ff4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96022
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-08 15:39:19 +00:00
Brian Wilkerson 9b0ac9ee03 Extract diagnostic tests in preparation for supporting ui-as-code features
Change-Id: Icfeb982a37b501b22189d87de42398c3f1516bee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95961
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-08 02:10:47 +00:00
Sam Rawlins 05be278603 Split MISSING_RETURN tests
Change-Id: I001d3dd2f1c2d1200ede738aa8d838fc0924ba1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2019-03-08 00:32:17 +00:00
Sam Rawlins bc02b6ce7d Split DEAD_CODE tests into their own file
Change-Id: I7d550ec240a10b839791cb5e00216c739af12d8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95666
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-07 18:28:37 +00:00
Brian Wilkerson f44fecbe39 Fix the way type arguments for iterable and map are accessed
Change-Id: I8d11fd4c10b8a5bc9fde633aba9987dba0ad59a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95742
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-07 18:04:12 +00:00
Konstantin Shcheglov e5a833b06b Comment out test that unexpectedly passes on Windows.
TBR

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

Change-Id: I34b9816ccc5d25c6b78b7db09ab7c0d70cf9c6c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95801
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-07 17:09:18 +00:00
danrubel 309140693c Revise non-nullable flag from AstBuilder to ErrorVerifier
This is one step in refactoring non-nullable enablement

* update AstBuilder to record isNonNullable in CompilationUnitImpl
* update ErrorVerifier to pull non-nullable from CompilationUnitImpl

Change-Id: I78e5f529330f10f294ad1c1b3b7ac8b672a5ee9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95426
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-07 13:29:45 +00:00
Brian Wilkerson a7d790bbbe Fix cast exception in resolution
Change-Id: Iefa49b509bec67522bbd916c41fc301d5d9d3811
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95705
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-06 23:57:31 +00:00
Paul Berry 0124541d5f Deprecate AST data structures that will be obseleted by the "UI as code" feature
- ForStatement and ForEachStatement will be replaced by ForStatement2.
- MapLiteral and SetLiteral will be replaced by SetOrMapLiteral.

To ease the transition, the old classes are subtypes of the new
classes, so even though the analyzer still creates instances of the
old classes, clients should be able to start referring to the new
classes in their code.  The analyzer will stop creating instances of
MapLiteral and SetLiteral when the experimental flags for the "UI as
code" feature are turned on, and will stop creating instances of all 4
classes when we bump the major version number (which should happen
sometime in March).

For visitors, we've updated the base classes with the following default methods:
  visitForStatement(node) => visitForStatement2(node);
  visitForEachStatement(node) => visitForStatement2(node);
  visitMapLiteral(node) => visitSetOrMapLiteral(node);
  visitSetLiteral(node) => visitSetOrMapLiteral(node);

So clients should be able to start revising their visitors to override
the new visit methods rather than the old ones, and the visit methods
in the base classes will automatically forward to the new visit
methods.

Change-Id: Ifde3a2aa3c8c49ce4e65dfaabf086db4dabb73f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95665
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-06 21:43:50 +00:00
Brian Wilkerson 17bf9d13b1 Delay disambiguating maps and sets until we know whether there are any conflicts
Change-Id: If55d8ab011047107f34a05a08e60ee54eabc0b44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95668
Reviewed-by: Paul Berry <paulberry@google.com>
2019-03-06 20:47:45 +00:00
Brian Wilkerson 079309fcd6 Create curly braces when resynthesizing map and set literals
Change-Id: I918624f0a07a02c98fdd2725a18fb3fd945eca8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95664
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-06 20:21:07 +00:00
Paul Berry 68c9909ef8 Re-apply workaround for bug fixed by closures containing type promotions in variables with inferred types.
ba5644b76c fixed an analyzer bug causing
a crash when a top level variable requiring type inference contained a
closure involving type promotion, and removed some explicit types that
were present in the analyzer to work around the bug.

Although the bug has been fixed now, the fix hasn't rolled out in a
release of the SDK.  So to avoid people seeing analysis server crashes
when editing the analyzer, I'm re-introducing the workaround.

Change-Id: I5e61345021cd33cb9ad1f017a7619815a38c6a1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95667
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-03-06 20:12:07 +00:00
Konstantin Shcheglov d1e60e0f3d Remove @failingTest from a test that stopped failing.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Id0fb24e38b09acce28b401d941f9ff81729b9e1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95701
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-06 19:35:58 +00:00
Konstantin Shcheglov 90b61e2fde Start implementing linker and resynthesizing.
Change-Id: Id1ad7925082f642d5dad7b01fa02b6c8cb76cf06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-06 17:29:29 +00:00