Johnni Winther
06bc0040cc
[cfe] Migrate experimental flag libraries
...
Change-Id: I621925a41de02b09071e9c2fbbb608961e9879b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196496
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-23 09:55:41 +00:00
Johnni Winther
16519008c5
[cfe] Migrate front_end libraries from wave 5
...
Change-Id: Id603bf1c94966131886ed24f65e0cd3b7b862852
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196490
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-23 07:19:11 +00:00
Kallen Tu
5c36a30de2
[cfe] Instance field get for const functions.
...
Change-Id: Ie090cbf47d1e5be82e59a3f782dea8b4c1c75c91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196380
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Jake Macdonald <jakemac@google.com >
Reviewed-by: Bob Nystrom <rnystrom@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2021-04-22 22:14:01 +00:00
Paul Berry
e3443b9f53
Flow analysis: implement "why not promoted" for binary/unary operator target.
...
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: If464a54bdb63fc661db312df5dc10f108049286a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196240
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2021-04-22 12:21:46 +00:00
Paul Berry
73db2ff205
Replace CFE and analyzer legacy type promotion with a shared implementation.
...
This allows us to remove a substantial amount of CFE and analyzer
code.
It also fixes a minor CFE type promotion bug
(language_2/type_promotion/assignment_defeats_promotion_lhs_and_test).
TEST=standard trybots
Change-Id: Ia0c159bdb9161d73648c9eb73b92822168f28d84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175583
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2021-04-21 14:21:30 +00:00
Johnni Winther
fdc765faad
[cfe] Make TypeParameter.defaultType non-nullable
...
TEST=existing
Change-Id: I0a8fdf09f742b55357411f12dc6164d4050bb83c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196283
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2021-04-21 13:51:50 +00:00
JustWe
5787ad0381
[CFE] add 'Function' as type identifier check in CFE
...
try resolve https://github.com/dart-lang/sdk/issues/45705 @eernstg
Closes https://github.com/dart-lang/sdk/pull/45736
https://github.com/dart-lang/sdk/pull/45736
GitOrigin-RevId: 2d91c32a34260014bbd5720e48a713eee180e65b
Change-Id: Ic416287137495926efe1d03da7d484202bd11272
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195761
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-21 04:43:48 +00:00
Kallen Tu
95229aa779
[cfe] Map [] operator enabled for const functions.
...
Change-Id: I19b0980fc100b3cd19da1875ec9fb08cdd1de70b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195620
Reviewed-by: Jake Macdonald <jakemac@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2021-04-20 20:19:18 +00:00
Johnni Winther
dd84fdb894
[kernel] Remove Name.name
...
Change-Id: Ida1a0f54061b114fa7b4c3c05aaf77908da5e858
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192305
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-20 13:06:37 +00:00
Dmitry Stefantsov
d7b0b515ab
[cfe] Forbid super-bounded typedef types as constructors
...
Closes #45658 .
Closes #45670 .
Bug: https://github.com/dart-lang/sdk/issues/45658
Bug: https://github.com/dart-lang/sdk/issues/45670
Change-Id: I5b588794a63f7b0aef84c3731ca26624ca8ff23a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195518
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
2021-04-20 11:29:27 +00:00
Johnni Winther
69d56fd82a
[kernel] Make TypeParameter.bound non-nullable
...
Change-Id: I31e693a5b77db039c6a2f8ac8ea534ad663ae0ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195988
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-20 10:56:56 +00:00
Nate Bosch
9443e248ee
Enable the triple shift experiment
...
Update the golden for a front_end test which adds additional constant evaluation
information now that the experiment is enabled.
A co19 test will start failing. https://github.com/dart-lang/co19/issues/1062
Change-Id: I18ec586f57deda83f6cd75e476137ab75d50a92f
TEST=No new tests.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193747
Auto-Submit: Nate Bosch <nbosch@google.com >
Commit-Queue: Nate Bosch <nbosch@google.com >
Reviewed-by: Leaf Petersen <leafp@google.com >
2021-04-19 21:04:38 +00:00
Kallen Tu
2d330c7985
[cfe] String [] operator for const functions.
...
Change-Id: Ia1ad96cd77d94c096bf8a10aa0377f37c79ed398
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195560
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Jake Macdonald <jakemac@google.com >
2021-04-19 17:17:48 +00:00
Johnni Winther
38cd5105b5
Reland [cfe] Migrate front_end libraries from wave 3-4
...
Change-Id: If7134e417a7820b26c7f96d87d483f0ba1c74919
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195923
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-19 15:05:48 +00:00
Johnni Winther
b7c19384b7
[cfe] Handle function types in the mixin on clause
...
Closes #45700
Change-Id: Ieaab6fff727ba2b7ecf4f02be820dc54fea2a9db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195903
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-19 13:11:28 +00:00
Johnni Winther
3e44898e08
[kernel] Make FileUriNode.fileUri non-nullable
...
TEST=existing
Change-Id: I72583e500cb0b69d9352b040c3e2885f9e0450c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195681
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2021-04-19 08:03:30 +00:00
Kallen Tu
2ab4ef2a13
[cfe] AbortStatus in return statements in constant evaluator.
...
Change-Id: I2b11774a43b9aa741ada913405154b3abbcf420f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195400
Reviewed-by: Jake Macdonald <jakemac@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2021-04-16 17:56:16 +00:00
Dmitry Stefantsov
025bcc486d
[cfe] Use the supertype locations when reporting errors
...
Closes #45626 .
Bug: https://github.com/dart-lang/sdk/issues/45626
Change-Id: I672efb0bba516534151630e6627959e0971840e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195515
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Erik Ernst <eernst@google.com >
2021-04-16 15:49:12 +00:00
Dmitry Stefantsov
903c16e773
[cfe] Don't report locations for function-type type parameters
...
Closes #45660 .
Bug: https://github.com/dart-lang/sdk/issues/45660
Change-Id: I6d28d339c0db1993773988c6bbd7f26bd4147c16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195514
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
2021-04-16 12:33:51 +00:00
Kallen Tu
4ac265efe5
[cfe] Universal error message for core errors for const functions.
...
Change-Id: I58cbbec918adad5e75ed6a7d6b8fb4bf2dcd6c0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195380
Reviewed-by: Jake Macdonald <jakemac@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2021-04-15 16:42:47 +00:00
Johnni Winther
2dbc8b18a2
Revert "[cfe] Migrate front_end libraries from wave 3-4"
...
Revert submission 195268
Reason for revert: Implicitly triggers running bin/* in sound null safety, revealing an unsafe use of List.length=
Reverted Changes:
I026ace4fd:[cfe] Migrate front_end libraries from wave 3-4
I9ba1f809b:[kernel] Migrate remaining bin/lib libraries in pa...
Change-Id: I3eb8130dfd5c21ddcfc33d0efd3150712fda8a47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195506
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2021-04-15 14:55:37 +00:00
Johnni Winther
dd2b04e41d
[cfe] Migrate front_end libraries from wave 3-4
...
Change-Id: I026ace4fd2563ec26439f630074eb35900839529
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195268
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-15 12:04:28 +00:00
Dmitry Stefantsov
7515fe5fe7
[cfe] Avoid using flattened lists of tuples in non-simplicity checks
...
Change-Id: If0e8220d3a155707cbb377c17213954dfe8e6ccf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195021
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2021-04-15 10:33:47 +00:00
Dmitry Stefantsov
91aecfcd5f
[cfe] Use i2b at the end of function call inference
...
Closes #45598 .
Bug: https://github.com/dart-lang/sdk/issues/45598
Change-Id: I37430faf057e3559ad6aefaa59d83d8a14320c54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194764
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2021-04-15 10:33:27 +00:00
Jens Johansen
a9e6de318c
[CFE] Avoid AllocateContext in ConstantEvaluator.canonicalize
...
putIfAbsent uses a closure and the VM allocates a context,
replacing it with ??= which doesn't should be better.
In a previous iteration it was found - with 95% confidence - a
~4ms (~10%) improvement, but for whatever reason those results
cannot currently be reproduced.
Change-Id: Id80a4eb0c0018c5827ab37b08507e70a5a5529a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194761
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2021-04-15 06:54:36 +00:00
Johnni Winther
47acb386d7
[cfe] Add id testing for inferred variable types
...
* including inferred parameter/return types for local functions
* added testing for inferred type arguments on literals and bounded variables
Change-Id: I02bceef3f5a41af7794cc63769cf4959321700d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195260
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2021-04-15 05:06:56 +00:00
Kallen Tu
c851cd31b5
[cfe] Core List properties enabled with const functions.
...
Change-Id: I3bac87b7be213756fc24fbb026f663f14c390e7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195200
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Jake Macdonald <jakemac@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2021-04-14 20:02:45 +00:00
Johnni Winther
d8f2b7cc44
[kernel] Make .function non-nullable on Procedure, Constructor, and LocalFunction
...
TEST=existing
Change-Id: I4d0ae16291414e58207b7de0466d989d27997619
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195074
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2021-04-14 08:17:28 +00:00
Jens Johansen
97742f827a
[CFE] Avoid AllocateContext in Scope.recordUse
...
Replacing putIfAbsent with containsKey (and inserting if not) gives an
improvement.
When compiling dart2js with fasta (from source), measuring only calls
to `recordUse` (which is called 1,549,231 times) (but measured
'outside' the method itself to include the `AllocateContext` cost)
I get the following:
Difference at 95.0% confidence
-37.2 +/- 18.2218
-18.5814% +/- 9.10179%
(Student's t, pooled s = 12.494)
i.e. almost 40 ms faster.
(this should be seen in a context of the entire compile taking
10+ seconds, but still).
Change-Id: I96cf521bb3cf760f14e4a407ff24638f019a8e21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194760
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2021-04-13 15:06:36 +00:00
Kallen Tu
f9536375e1
[cfe] Invalid empty return statements in const function invocations.
...
Change-Id: Id1408bff917200f3825846bd6d483e52ca326d5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194840
Reviewed-by: Jake Macdonald <jakemac@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2021-04-13 14:49:06 +00:00
Dmitry Stefantsov
4658b9ee6b
[cfe] Introduce ExtensionType into isSubtypeOf
...
Change-Id: Iea88e7355d7eee9d82c0c41247407fe1178ee049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195068
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
2021-04-13 13:05:57 +00:00
William Hesse
0cb6607cf1
[sdk] Bump version to 2.14
...
TEST=CI presubmit with added tryjobs
Change-Id: I6c4f7de9d3fbe6d1031f6f0161e8ffebcea822a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195062
Commit-Queue: William Hesse <whesse@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Alexander Thomas <athom@google.com >
2021-04-13 12:47:27 +00:00
Johnni Winther
9dff91e2a5
[cfe] Add id testing for inferred type arguments
...
Change-Id: If932af54e184fcd7bb19a6889edf459c660f0cdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195020
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Paul Berry <paulberry@google.com >
2021-04-13 09:10:38 +00:00
Kallen Tu
9bd43c3071
[cfe] Uninitialized variable declarations in const functions.
...
Change-Id: I1c27902a0af7648b4352b0cd21691cf9f88b78fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194460
Commit-Queue: Kallen Tu <kallentu@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Bob Nystrom <rnystrom@google.com >
Reviewed-by: Jake Macdonald <jakemac@google.com >
2021-04-12 15:42:26 +00:00
Johnni Winther
64460ec47f
[kernel] Make Member.name non-nullable
...
Change-Id: Id2befd868e93985d6af463c2ccd410cd56b68187
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194721
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-12 13:48:46 +00:00
Kallen Tu
0b175ed534
[cfe] Const constructors enabled with const functions.
...
Change-Id: Ic0597bf7ec69811ec822539ef5df1e24ef1b9884
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194560
Reviewed-by: Jake Macdonald <jakemac@google.com >
Reviewed-by: Bob Nystrom <rnystrom@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2021-04-09 21:10:53 +00:00
Johnni Winther
282a3ab70b
[cfe] Handle ParserRecovery in beginTypeVariable
...
Closes #45329
Change-Id: I7e153e41891332bd8ea85849b993066de342eed5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194682
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-04-09 09:38:31 +00:00
Kallen Tu
6f90c5531e
[cfe] Closures and environment changes for const functions.
...
Change-Id: If844a28192c1eef4dcbb62075ae07e86297f2c92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193920
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Bob Nystrom <rnystrom@google.com >
Reviewed-by: Jake Macdonald <jakemac@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2021-04-08 15:09:39 +00:00
Kallen Tu
5bcaf448af
[cfe] Try-catch, try-finally, throw for const functions.
...
Change-Id: Id25f78bba9c65e702bcd5051c776782a146e0605
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193780
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Bob Nystrom <rnystrom@google.com >
Reviewed-by: Jake Macdonald <jakemac@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2021-04-07 21:40:38 +00:00
Paul Berry
363da90385
Fix "why not promoted" functionality for compound indexed assignment.
...
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I40c6087a0db2c67106f9ce138b79a8a5769b37de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193834
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2021-04-07 11:39:12 +00:00
Paul Berry
b13dea3e1e
Reland "Flow analysis: track property get targets."
...
This is a reland of bc6cdf54fd
Original change's description:
> Flow analysis: track property get targets.
>
> These targets are needed for "why not promoted" error messages, and
> it's easier to have flow analysis keep track of them than to have the
> analyzer and CFE try to reconstruct them at the time of reporting the
> error.
>
> Bug: https://github.com/dart-lang/sdk/issues/44898
> Change-Id: Ia8ef4a7ce13cc30860e59b7369e6230d233e252d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193832
> Commit-Queue: Paul Berry <paulberry@google.com >
> Reviewed-by: Johnni Winther <johnniwinther@google.com >
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: Ib5e6a0eafb381f3a9c8770c6c1c3e55581e44b01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194105
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: William Hesse <whesse@google.com >
2021-04-07 11:39:12 +00:00
Johnni Winther
5f57456528
[cfe] Support experimental flags and language versions in message_suite.dart
...
Change-Id: I150a93834783219c73f9dc4961eb83a48a7ea7e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194067
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2021-04-07 11:31:07 +00:00
Johnni Winther
9d80c4db57
[kernel,vm] Migrate vm transformations in package:kernel
...
TEST=existing
Change-Id: I86dfda23fa32ecb924fa6c202e7142cb8a258dc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192145
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Aske Simon Christensen <askesc@google.com >
2021-04-07 08:30:47 +00:00
Kallen Tu
b5d4d26abe
[cfe] Const factories when const functions enabled.
...
Change-Id: Ifd24678c0ac191c5cc6f1d60443ab96f56cbba7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192400
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Jake Macdonald <jakemac@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Kallen Tu <kallentu@google.com >
2021-04-06 19:46:32 +00:00
Paul Berry
cf7587a160
Revert "Flow analysis: track property get targets."
...
This reverts commit bc6cdf54fd .
Reason for revert: Broke Golem benchmarks - https://golem.corp.goog/PerformanceChanges?repository=dart&revision=91561
Original change's description:
> Flow analysis: track property get targets.
>
> These targets are needed for "why not promoted" error messages, and
> it's easier to have flow analysis keep track of them than to have the
> analyzer and CFE try to reconstruct them at the time of reporting the
> error.
>
> Bug: https://github.com/dart-lang/sdk/issues/44898
> Change-Id: Ia8ef4a7ce13cc30860e59b7369e6230d233e252d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193832
> Commit-Queue: Paul Berry <paulberry@google.com >
> Reviewed-by: Johnni Winther <johnniwinther@google.com >
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
TBR=paulberry@google.com ,scheglov@google.com ,johnniwinther@google.com
Change-Id: Ic2b66b1db621c0f4e4c5398acfe2ae61bd7625ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/44898
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194104
Reviewed-by: Paul Berry <paulberry@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2021-04-06 11:49:09 +00:00
Paul Berry
bc6cdf54fd
Flow analysis: track property get targets.
...
These targets are needed for "why not promoted" error messages, and
it's easier to have flow analysis keep track of them than to have the
analyzer and CFE try to reconstruct them at the time of reporting the
error.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: Ia8ef4a7ce13cc30860e59b7369e6230d233e252d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193832
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2021-04-06 06:55:28 +00:00
Paul Berry
72bc3134c5
Unify "why not promoted" representations for for-loops and other writes.
...
This CL changes the responsibility for doing flow analysis of the
implicit variable write in a `for-in` loop as follows: if the `for-in`
loop does not declare a variable, but it assigns to a local variable,
then the flow analysis client is responsible for calling `write` on
entry to the loop.
This in turn allows us to use a single code path to track "why not
promoted" information related to all possible local variable writes;
we no longer need as much special case logic to handle for-in loops.
To make the analyzer integration slightly cleaner, we change the
argument type of FlowAnalysis.write to Node rather than Expression, so
that the analyzer can pass in the ForEachParts object when analyzing a
for-in loop.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: I24b47be8eac2e276cd291a5b2f2e4444c911138f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193837
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2021-04-03 15:28:36 +00:00
Leaf Petersen
39a2e69ea4
Enable non-function type aliases by default in 2.13.
...
TEST=language/nonfunction-type-aliases
Change-Id: Ifff4e838fbfc4f71e2d990e1f1f8a67b987adf91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192948
Commit-Queue: Leaf Petersen <leafp@google.com >
Reviewed-by: Erik Ernst <eernst@google.com >
2021-04-03 01:31:42 +00:00
Paul Berry
c25e74852c
Add links to "why not promoted" error messages.
...
These links are not live yet, but they will be filled in with
documentation explaining subtleties of type promotion in more detail.
Bug: https://github.com/dart-lang/sdk/issues/44900
Change-Id: I3e1865597fc5c56495a8108c8a4de98cab0c3e4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193749
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-01 16:42:12 +00:00
Dmitry Stefantsov
904882fce3
[cfe] Check rhs of typedefs for regular-boundness
...
Closes #42435 .
Closes #45491 .
Closes #45493 .
Bug: https://github.com/dart-lang/sdk/issues/42435
Bug: https://github.com/dart-lang/sdk/issues/45491
Bug: https://github.com/dart-lang/sdk/issues/45493
Change-Id: I368aff553a8bdd5e5312ecf06f0d19c8390a0d22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193662
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2021-04-01 12:26:43 +00:00