Commit Graph

31 Commits

Author SHA1 Message Date
Dmitry Stefantsov c191551fac [cfe] Remove BottomType
TEST=Covered by existing tests.

Change-Id: Ied8be1874164e68e0a3a48e1b2f9a33310071381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183009
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-24 13:21:55 +00:00
Johnni Winther 56f46b0659 Remove non-nullable experiment flag from front_end test cases.
This changes the CFE expectation test suites to use unsound null safety
as default to avoid passing --enable-experiments=no-non-nullable to opt
out old test folders.

This change removes most test folders from the 'strong' tester, since
this now only supports sound null safety, which requires all libraries
to be opted in. Instead, the 'weak' tester now runs all test folders.
Additionally the 'outline' tester is changed to use unsound null safety
so that it call be used on all test folders.

The 'fast_strong' tester is removed since it should just be run locally
and it can be run by passing an option to the other testers.

References to non-existing 'shaker' folder has been removed from
testing.json.


Change-Id: Ibcc306f7b27d06b9637c205238bc408194f1d062
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184787
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-18 12:29:18 +00:00
Clement Skau 2d36c85ff8 [vm] Removes support for --causal-async-stacks
All existing embedders have been opted into --lazy-async-stacks, the
VM also uses it as it's default in all configurations.

After this CL, any user of --causal-async-stacks will get an error
message when trying to use it.
=> In any such case, please simply remove the flag.

TEST=Exhaustive CQ.

Bug: https://github.com/dart-lang/sdk/issues/37668
Change-Id: Ia440afcf2dba464aa8b8cf381b93bbac8eb9f8dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172564
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-12-01 07:27:14 +00:00
Clement Skau 27ca552ddb [SDK] Replaces async's _AsyncAwaitCompleter with _Future.
Run time (less is better) impact:
dart:
- Calls.AwaitAsyncCall  -43.95% ~ -55.50%
- Calls.AwaitAsyncCallClosureTargetPolymorphic  -40.33% ~ -53.58%
- Calls.AwaitAsyncCallInstanceTargetPolymorphic  -42.69% ~ -55.65%
- Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits  -42.05% ~ -56.14%
- Calls.Await...  0% ~ -13%
dart-aot:
- Calls.AwaitAsyncCall  -9.748% ~ -11.13%
- Calls.AwaitAsyncCallClosureTargetPolymorphic  -8.673% ~ -13.19%
- Calls.AwaitAsyncCallInstanceTargetPolymorphic  -9.799% ~ -11.74%
- Calls.AwaitFutureOrCallInstanceTargetPolymorphicManyAwaits  -5.412% ~ -13.43%

Code size impact:
- flutter_gallery_app_so_brotli_size  -0.1237% ~ -0.2410%
- flutter_gallery_readonlydata_size  0.1693% ~ 0.2041%
- flutter_gallery_instructions_size  0.1157% ~ 0.1779%
- flutter_gallery_total_size  0.1021% ~ 0.1413%

Bug: https://github.com/dart-lang/sdk/issues/39119
Change-Id: I64d28a8bea078277946d7be43737e265920c8f16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126322
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-05 09:51:13 +00:00
Johnni Winther 137c7b6c84 [cfe] Explicitly run front_end unittest without non-nullable
This prepares front_end unittests for turning on non-nullable by default.

Change-Id: I9588a2d026ab9f5b1dcf08a140d25bd5dca3d5bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168346
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-10-20 13:13:33 +00:00
Jens Johansen a9ddd4bb96 [CFE] Change Set-literal transformation from nested let to BlockExpression
Fixes #43756.

Change-Id: Ib126ba8b91ae0d0c222383b51418b3d9f730bcfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168022
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-19 07:16:36 +00:00
Jens Johansen 65968a481b [kernel] ast-to-text shows combinators for imports/exports
Change-Id: If153dded362eb1fe5f4c52a92206ff8e86579c1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159248
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-20 10:24:48 +00:00
Alexander Markov 4ef577d50e [vm/tfa] add map/set factory specializer to support infer metatype
https://github.com/dart-lang/sdk/issues/37861

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

GitOrigin-RevId: 508f49256f1916e862c6d6f48efc77406d0b63de
Change-Id: Iec6786bcd4fa09704c533cbff6957130aa524ada
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157240
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-08-12 19:20:38 +00:00
Jens Johansen 6de0f53e7c [CFE] Set correct async markers in outline phase (2nd try)
This reverts commit b4b44d6b4b.

Change-Id: Iae68e6e84e0fbb214b22e1dec6788057f80a50ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153345
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-07-07 07:49:58 +00:00
Jens Johansen b4b44d6b4b Revert "[CFE] Set correct async markers in outline phase"
This reverts commit 2ad66bbffe.

Reason for revert: Seems to break some internal tests.

Original change's description:
> [CFE] Set correct async markers in outline phase
> 
> Change-Id: I4ac1fe1f4195dea2c20b8e55963b7e7dffc2d289
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152330
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Jens Johansen <jensj@google.com>

TBR=jensj@google.com,johnniwinther@google.com

Change-Id: Iaa272f1bee8f99dd93e9a351a03a67f67d83e871
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152641
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-06-26 07:49:57 +00:00
Jens Johansen 2ad66bbffe [CFE] Set correct async markers in outline phase
Change-Id: I4ac1fe1f4195dea2c20b8e55963b7e7dffc2d289
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152330
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-06-25 10:29:28 +00:00
Dmitry Stefantsov 929d5e4a98 [cfe,ddc,dart2js,vm] Add FutureOrType
This CL is the sum of the following 5 CLs:
* https://dart-review.googlesource.com/c/sdk/+/149297/
* https://dart-review.googlesource.com/c/sdk/+/149299/
* https://dart-review.googlesource.com/c/sdk/+/149320/
* https://dart-review.googlesource.com/c/sdk/+/149321/
* https://dart-review.googlesource.com/c/sdk/+/149323/

The reason for landing the 5 CLs as one CL is to prevent potential
troubles with bisecting over the branch because the change is fully
functional only with all 5 CLs.

Closes #40123.

Bug: https://github.com/dart-lang/sdk/issues/40123
Change-Id: Ice52250a98acfe455b1d7fa5bb0624c115ca5dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150934
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-06-15 12:18:46 +00:00
Clement Skau 2359f4dc68 [VM] Reworked: Remove unnecessary Closure.clone() from sync*.
Removes the Closure.clone() in sync* by adding an additional closure
around the rewritten sync* function body.

This is a re-worked version of the now reverted:
- https://dart-review.googlesource.com/c/sdk/+/136190
- https://dart-review.googlesource.com/c/sdk/+/144948

This CL includes changes from both the above CLs, in addition to:
- A new 'ShadowRewriter' transformer to do deep rewriting of
  shadowed parameters.
  Previous versions only rewrote the immediate sync* function, missing
  references in nested rewritten functions.

Note: This CL is re-landing largely unchanged since the roll-blocking
issues suspected to be caused by this was later attributed to a
different set of changes.
I have independently re-run all failing external tests to verify
them passing for this CL.

Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: Id1670a93961180e8558d7c7eca65fe7e9115f07b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145402
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-05-05 12:04:03 +00:00
Johnni Winther a9b81e18d9 [cfe] Handle dynamic return in async
Closes #41437

Change-Id: I493b516f0b72fc1da097b92bd75150aea8e60ba7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145042
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-30 12:39:04 +00:00
Jens Johansen c08bcbb25e [CFE] Enable textual outline sorting in test suite
Change-Id: Iccf35b9cb3dce96487ca9ba688394e3b05be2e75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145401
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-04-30 08:25:17 +00:00
Jens Johansen f66e1ed7be [CFE] Textual outline expect files
Change-Id: I5cc3339880d0a77fbbcbd9f8a22e1186e5e2a5df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145380
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-04-30 08:25:17 +00:00
Clement Skau 12a5c93d4a Revert "Reland "[VM] Remove unnecessary Closure.clone() from sync*.""
This reverts commit 1bf25798fa.

Reason for revert: Rolling back as it breaks more external targets and is currently blocking rolls.

Original change's description:
> Reland "[VM] Remove unnecessary Closure.clone() from sync*."
> 
> This reverts commit 430c75b5fa.
> 
> Reason for revert: We probably don't care about the dartkb breakages.
> 
> Original change's description:
> > Revert "[VM] Remove unnecessary Closure.clone() from sync*."
> > 
> > This reverts commit ca94ad7112.
> > 
> > Reason for revert: Appears to break dartkb.
> > 
> > Original change's description:
> > > [VM] Remove unnecessary Closure.clone() from sync*.
> > > 
> > > Instead, this CL wraps sync*'s sync_op in an additional function
> > > that captures local copies of the necessary closure state.
> > > Notably this state includes the parameters of the original sync* function
> > > as these also need to be cloned for each instance.
> > > 
> > > 
> > > Note: a large number of .expect files have a small number of changes
> > > due to the additional wrapper function, as well as some extra plumbing.
> > > 
> > > Bug: https://github.com/dart-lang/sdk/issues/37753
> > > Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
> > > Commit-Queue: Clement Skau <cskau@google.com>
> > > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> > 
> > TBR=vegorov@google.com,cskau@google.com
> > 
> > Change-Id: I89e517196f03622337f909f0fcecbdc77c9dda93
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: https://github.com/dart-lang/sdk/issues/37753
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144920
> > Reviewed-by: Clement Skau <cskau@google.com>
> > Commit-Queue: Clement Skau <cskau@google.com>
> 
> TBR=vegorov@google.com,cskau@google.com
> 
> Change-Id: I78589c83cbb17151ca4ab8f811b4f18f252fb9c1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144921
> Reviewed-by: Clement Skau <cskau@google.com>
> Commit-Queue: Clement Skau <cskau@google.com>

TBR=vegorov@google.com,cskau@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: I879df17bd282d01468fa010b94a8c89afdb8cd0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145361
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-04-29 09:52:30 +00:00
Clement Skau 1bf25798fa Reland "[VM] Remove unnecessary Closure.clone() from sync*."
This reverts commit 430c75b5fa.

Reason for revert: We probably don't care about the dartkb breakages.

Original change's description:
> Revert "[VM] Remove unnecessary Closure.clone() from sync*."
> 
> This reverts commit ca94ad7112.
> 
> Reason for revert: Appears to break dartkb.
> 
> Original change's description:
> > [VM] Remove unnecessary Closure.clone() from sync*.
> > 
> > Instead, this CL wraps sync*'s sync_op in an additional function
> > that captures local copies of the necessary closure state.
> > Notably this state includes the parameters of the original sync* function
> > as these also need to be cloned for each instance.
> > 
> > 
> > Note: a large number of .expect files have a small number of changes
> > due to the additional wrapper function, as well as some extra plumbing.
> > 
> > Bug: https://github.com/dart-lang/sdk/issues/37753
> > Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
> > Commit-Queue: Clement Skau <cskau@google.com>
> > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> 
> TBR=vegorov@google.com,cskau@google.com
> 
> Change-Id: I89e517196f03622337f909f0fcecbdc77c9dda93
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144920
> Reviewed-by: Clement Skau <cskau@google.com>
> Commit-Queue: Clement Skau <cskau@google.com>

TBR=vegorov@google.com,cskau@google.com

Change-Id: I78589c83cbb17151ca4ab8f811b4f18f252fb9c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144921
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-04-28 06:17:20 +00:00
Clement Skau 430c75b5fa Revert "[VM] Remove unnecessary Closure.clone() from sync*."
This reverts commit ca94ad7112.

Reason for revert: Appears to break dartkb.

Original change's description:
> [VM] Remove unnecessary Closure.clone() from sync*.
> 
> Instead, this CL wraps sync*'s sync_op in an additional function
> that captures local copies of the necessary closure state.
> Notably this state includes the parameters of the original sync* function
> as these also need to be cloned for each instance.
> 
> 
> Note: a large number of .expect files have a small number of changes
> due to the additional wrapper function, as well as some extra plumbing.
> 
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,cskau@google.com

Change-Id: I89e517196f03622337f909f0fcecbdc77c9dda93
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144920
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2020-04-27 07:45:04 +00:00
Clement Skau ca94ad7112 [VM] Remove unnecessary Closure.clone() from sync*.
Instead, this CL wraps sync*'s sync_op in an additional function
that captures local copies of the necessary closure state.
Notably this state includes the parameters of the original sync* function
as these also need to be cloned for each instance.


Note: a large number of .expect files have a small number of changes
due to the additional wrapper function, as well as some extra plumbing.

Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-04-27 07:37:39 +00:00
Martin Kustermann e2b6cc93b6 [vm/async] Update async transformation to take NNBD mode into account
The removal of unsafeCast causes flutter galley size regressions:

  - armv7: -0.43%
  - armv8: -0.21%

which we should look into recovering by having better inlining heuristics.

Issue https://github.com/dart-lang/sdk/issues/41373
Closes https://github.com/dart-lang/sdk/issues/41307

Change-Id: I7c0ba4c9598e13f01e807a607c83d50cf03e9abe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142501
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-04-11 08:56:52 +00:00
Martin Kustermann c4a7c3488e [vm/async] Make async transformer use typed variables, make async patch use function types
This gets rid of a slow AssertAssignable (function type test)
in _asyncThenWrapperHelper/_awaitHelper, which currently falls back to the slow table
search:

  AssertAssignable
    ^--> TypeTestingStub
          ^--> SlowTypeTestStub
               ^--> Subtype6TestCacheStub

Issue https://github.com/dart-lang/sdk/issues/37668

Change-Id: I3b6517b7e348e39619e8096d6ac2a4b179bb3242
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142022
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2020-04-03 08:28:47 +00:00
Johnni Winther 970c164826 [cfe] Use correct types in transformations and start verifying getStaticType
With this fix Expression.getStaticType no longer throws on any known cases.
Users of getStaticType can therefore avoid enclosing static type computation
in try-catch.

Closes #38597

Change-Id: I52eaacd30256333d7c368e5d14f4e4956bafc96f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121988
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-11-21 22:15:58 +00:00
Aske Simon Christensen 8f24bd2901 [cfe] Remove or reformulate some bad tips and messages.
Change-Id: I5f37da30370fb48a4417e2b0c990d9fc1c9713a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118990
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-30 09:02:41 +00:00
Johnni Winther 7f9f4ad774 [cfe] Delete legacy tests
+ make sdk_test test non-legacy

Change-Id: Ie9861e54d12301f454d4fccf6eccd3516e0387d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113825
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-21 09:01:44 +00:00
Dmitry Stefantsov 20e4c74f7f [fasta][nnbd] Print NNBD type modifiers in Kernel's text representation
Change-Id: I48c43858094e2b7264a15be05238bfc3dadd5ecb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108264
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-07-31 08:26:14 +00:00
Kevin Millikin 0828d2c786 [Fasta] Implement exact types for Set literals
Set literals have an exact type of Set<T> for some T.  An implicit
downcast to a subtype is a static error.

Change-Id: I922b078b1b9e595243520e73c7130c23fe91f454
Reviewed-on: https://dart-review.googlesource.com/c/91640
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-02-05 07:43:52 +00:00
Jens Johansen 1bad9304a0 Print user-imports and parts when printing ast to text
Also remove some duplicated code so libraries are mostly only printed
in one place.

Change-Id: I7cb86bff1938f05631d7eb3432deda2c9939f402
Reviewed-on: https://dart-review.googlesource.com/c/90226
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-01-21 12:10:16 +00:00
Jens Johansen dab228e55f Save problems in ast - fasta changes
Change-Id: Id38f5e7495c245e5a7b161b55c58b8826c146a80
Reviewed-on: https://dart-review.googlesource.com/c/90000
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-17 10:46:13 +00:00
Aske Simon Christensen 1842020a69 Fix empty set/map literal disambiguation rule.
The criterion for an empty set/map literal without type arguments to
become a set literal was implemented as "superclass of Set and not
superclass of Map". This CL changes it to the rule now stated in the
spec: "subtype of Iterable and not subtype of Map".

Change-Id: I52d3a11e29ed9b1feb0f2b52a3f4beebe3833e31
Reviewed-on: https://dart-review.googlesource.com/c/88828
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-11 15:14:05 +00:00
Aske Simon Christensen 6a756ac040 Add front-end test for set/map literal disambiguation.
The test exposes three problems:

- The disambiguation criterion in the type inference is incorrect, as
  it infers a map when the context is a LinkedHashSet. This will be
  fixed in an upcoming CL.

- Assigning a map literal to a LinkedHashMap produces a static error
  ("isn't of expected type") due to exact types. Rules for exact types
  are currently unspecified, and the language team has expressed some
  interest in allowing this case. See also
  https://github.com/dart-lang/sdk/issues/33307

- Type arguments for the map literal are not inferred from the context
  when the outer context type is a LinkedHashMap. This is consistent
  between the CFE and analyzer. If the LinkedHashMap case is to be
  supported, this must be fixed as well.

Change-Id: I1519c844dae1f599306446c992cfe4825e4f20d4
Reviewed-on: https://dart-review.googlesource.com/c/88726
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-11 15:14:05 +00:00