Johnni Winther
f26c0e2056
[cfe] Add explicit type argument to .map(...).toList()
...
Expressions like
List<VariableDeclaration> variables = ...
List<Expression> reads = variables.map((v) => VariableGet(v)).toList()
don't get the intended type argument `<Expression>` through inference,
but instead the type inferred from the return type of the closure, in
this case `<VariableGet>`.
This causes problems when used with the AST which assumes that
expressions are interchangeable wherever they are used, and is likely
the cause of https://github.com/flutter/flutter/issues/102077 .
This CL adds an explicit type argument in these cases.
TEST=general/infer_map
Change-Id: I0bcae21f06c54f290dc20686b0d84c065d8ea04c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241605
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Sigmund Cherem <sigmund@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2022-04-20 06:56:58 +00:00
Johnni Winther
c206ec38ce
[cfe] Pass ReferenceFromIndex to value class transformation
...
This fixes fuzz testing for value_class/empty,
value_class/explicit_mixin, and value_class/value_mixin_error
Change-Id: Ia098b3ed5b8a028f1a28c5579fe5df11e5a92ff0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217185
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2021-10-19 10:02:38 +00:00
Sam Rawlins
8d04e49078
Remove redundant imports
...
Each of these imports removed is redundant with
'package:kernel/ast.dart'.
Bug: https://github.com/dart-lang/sdk/issues/44569
Change-Id: Ia9bc08b4ffd863572c84fe8a4fa465d2e8e04f7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213845
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2021-09-20 15:25:01 +00:00
Johnni Winther
097a511d9f
[kernel] Add annotate_overrides lint
...
Change-Id: I1fffd60eeb14ecd6d5ba30cd584a75ddd4a8acfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212005
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2021-09-01 11:45:17 +00:00
Johnni Winther
cb3a9b0043
[cfe] Remove old method invocation encoding nodes
...
TEST=existing
Change-Id: I05ee649ecfa7945e2e0f5e5d09441d8916a9c46e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208185
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2021-07-28 15:44:04 +00:00
Johnni Winther
1adf5dc7c6
[cfe] Verify that only new method invocation nodes are generated when supported
...
Closes https://github.com/dart-lang/sdk/issues/46339
Change-Id: I404a8afd141f615cfcb6050f280a1410adaac0ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204580
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2021-06-23 09:41:35 +00:00
Johnni Winther
71293ec389
[kernel] Migrate scanner and value_class
...
Change-Id: Id4ff972a9a56e878a991680f76f6264b55db27eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195240
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2021-04-14 13:35:44 +00:00
Johnni Winther
01b0947a6d
[kernel] Update kernel encodings
...
* Add InstanceGetterInvocation for getter/field invocation in web
backends
* Add localFunction getter to LocalFunctionInvocation
* Remove isNot from EqualsCall and EqualsNull - the encoding didn't
carry its weight.
* Remove uses of Name.name
* Remove BottomType code from VM
TEST=existing
Change-Id: I99d05d35b9ef193d092cc151c99ad472dbd60834
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188725
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2021-03-08 11:29:51 +00:00
Johnni Winther
34fb48bb8a
[kernel,front_end] Migrate first wave of pkg/kernel and pkg/front_end
...
Migrates libraries dependent only on already migrated libraries.
Change-Id: I0e85ee8dbc2afce031b92e0009e71c206a55af28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179502
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Jens Johansen <jensj@google.com >
2021-01-18 15:40:21 +00:00
Jens Johansen
ae5fc78992
[kernel] Remove 'addMember'
...
Most of the time one already knows at the call site if it's a Field,
a Procedure etc --- so use that instead.
For now I'll leave the corresponding getters that are basically
documented as "don't use" ("[...] for convenience, not efficiency.
Consider manually iterating the members [...]").
Change-Id: Ib732759432c62963e6645f85f6df301c4281df9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168826
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-10-27 11:36:58 +00:00
Jens Johansen
fc7de901ee
[kernel] Make LogicalExpression operator an enum (and rename)
...
Change-Id: I6054e8e44133d2419582d74700c4223d51495978
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165606
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2020-10-02 09:41:12 +00:00
jlcontreras
8e283cb8c8
[cfe] Implements addToString to value class transformations
...
Change-Id: I431f72a103142788f886bce03f59320a67cd7d71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164961
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-10-01 16:00:48 +00:00
jlcontreras
75ffae6a5c
[cfe] Implements recursiveScanner to solve copyWith ambiguities
...
Change-Id: I087e12702d8164ad0a7383bb5b0665d58a516f7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162743
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
2020-09-24 17:32:57 +00:00
Johnni Winther
f4501b6e83
Reland "[kernel] Rename Name.name to Name.text"
...
Including a deprecated getter to avoid breaking dependent code outside
the Dart repo.
Change-Id: I365957b7c2da6e0cb5c71eb8d2906b0dc6ff18ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163062
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-17 06:10:49 +00:00
Johnni Winther
644df9b9fb
Revert "Reland: [kernel] Rename Name.name to Name.text"
...
This reverts commit c430a0ac0b .
Reason for revert: Will break flutter_frontend_server when rolled into google3
Original change's description:
> Reland: [kernel] Rename Name.name to Name.text
>
> Change-Id: I5240b0ff09faf35184998920202d7600dc97766d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162746
> Reviewed-by: Johnni Winther <johnniwinther@google.com >
> Commit-Queue: Johnni Winther <johnniwinther@google.com >
TBR=jensj@google.com ,johnniwinther@google.com
Change-Id: Ib6961f49dd416171c5d5935c490d79d6f7be779e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162748
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-16 08:22:55 +00:00
Johnni Winther
c430a0ac0b
Reland: [kernel] Rename Name.name to Name.text
...
Change-Id: I5240b0ff09faf35184998920202d7600dc97766d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162746
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-16 07:42:42 +00:00
Daco Harkes
7302e01a79
Revert "[kernel] Rename Name.name to Name.text"
...
This reverts commit 3ff8dd2f51 .
Reason for revert: Fails all CI builders. Possibly something landed
in the mean time.
Original change's description:
> [kernel] Rename Name.name to Name.text
>
> Change-Id: I93162fb387ba123b949e19a7829bd5614845b15d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162722
> Reviewed-by: Jens Johansen <jensj@google.com >
> Commit-Queue: Johnni Winther <johnniwinther@google.com >
TBR=jensj@google.com ,johnniwinther@google.com
Change-Id: I2ffe526dabf37ae09d5e4ab1fbe514925f6e8768
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162744
Reviewed-by: Daco Harkes <dacoharkes@google.com >
Commit-Queue: Daco Harkes <dacoharkes@google.com >
2020-09-15 15:21:35 +00:00
Johnni Winther
3ff8dd2f51
[kernel] Rename Name.name to Name.text
...
Change-Id: I93162fb387ba123b949e19a7829bd5614845b15d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162722
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-15 14:27:22 +00:00
jlcontreras
291b2dffc0
[cfe] Implements copyWith in valueClass transformation
...
Change-Id: I37d32c23176a9324c313031fcb283f6ab7250944
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162703
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
2020-09-14 13:11:58 +00:00
jlcontreras
da6cdc55b4
[cfe] Implement addHashCode to valueClass transformation
...
Change-Id: Ie566cee214b63f986e07c84e4ae28bfecc80e0a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162186
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-09-11 16:05:52 +00:00
jlcontreras
69b194e88f
[cfe] Implements ValueClassScanner
...
Change-Id: I36b839280513a75d92797d5999ecb567e6999a5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162180
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-09-09 14:10:08 +00:00
jlcontreras
173a958d37
[cfe] Implement addEqualsOperator in value class transformation
...
Change-Id: I07afadfe9d23f792edb61681e794faa4de6aebb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161506
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
2020-09-08 18:30:55 +00:00
jlcontreras
70fd140a9d
[cfe] Implements addConstructor of value class transformation
...
Change-Id: I991c82693a6a3a44061efa7703fa89bd94f858b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158280
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-08-31 13:24:38 +00:00
jlcontreras
0f0e04ec3a
Add empty value class transformer.
...
Change-Id: I8e532c1699785ed75c7eff7a3187a4ca3a2032e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156880
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
2020-08-03 14:14:42 +00:00