Commit graph

123 commits

Author SHA1 Message Date
Jens Johansen 9985bad4ea [CFE] Remove unused fasta/sdk_test.dart
Also remove 'onlyCrashes' option which was only used there.

Change-Id: Iba1486058d561284d71aabf13431f302e7c5b9b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346520
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-16 13:18:57 +00:00
Jens Johansen bf96a722bc [frontend_server] CFE team takes ownership of package:frontend_server
First of we apply the wanted lints etc we prefer.
This includes but isn't limited to using types (i.e. no "var") and
being explicit about creation (i.e. no missing "new").

Change-Id: I516bccdac9760221ea5311af4567466bb4a65c77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341960
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-12-19 10:38:28 +00:00
Alexander Thomas a9cb6fbb0d [cleanup] Remove references to _2 tests from pkg/front_end
Bug: b/310114753
Change-Id: If8ffa9e6132d058e63608213d606056197c15e61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336962
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-11-27 09:10:34 +00:00
Johnni Winther 56a86e599e [cfe,ddc] Add tests for scopes in extensions, extension types and mixins
This adds support using experimental features in id testing in DDC and
uses it to add tests for scopes in extensions, extension types and
mixins.

The tests show that the DartScopeBuilder and DartScopeBuilder2 differ
on the scope on instance members in extensions and extension types for
the synthetic #this variable.

Change-Id: Iec0f3b938da567578b1245ada885370fb2a8b33f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335824
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-11-16 09:37:31 +00:00
Alexander Thomas 9394b30b77 Fix incorrect file reference in license headers
Bug: b/286184681
Change-Id: I903528c4adfbc576644aec7541903df6b9633e26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325523
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-09-18 06:44:08 +00:00
Johnni Winther e42bb83d32 [cfe] Add test folder for dart2wasm
This adds support for testing how the dart2wasm target implementation
integrates with the CFE. The added tests show the current state of
the for-in and yield transformations performed by wasm.

Change-Id: I7fc1efab22311667dcf4357ba54fa45321581074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278000
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-01-02 15:43:58 +00:00
Johnni Winther 323d5bf05e [cfe] Run all but nnbd_mixed tests in strong mode
Change-Id: I96947e3b2790067add9b956904af375a222bb640
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276081
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-12-19 12:44:47 +00:00
Johnni Winther c0a577a8db [cfe] Remove language version from inference testcases
Change-Id: I796eab1fe2d8f771d5caabfae06e78bb11f367ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250846
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-07-08 12:52:19 +00:00
Chloe Stefantsova 95d8a5d41a [cfe] Remove Kernel round-trip text serialization
Change-Id: Ifdf0df0b93773f95eb1646a313c15e0a578b5a8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249181
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-06-21 10:28:24 +00:00
Johnni Winther 31f7a48baf [cfe] Remove language version from expectation tests
This removes unneeded language version from expectation tests in the
implicit_getter_calls/, rasta/, regress/, runtime_checks/,
runtime_checks_new/, set_literals/, and unified_collections/ folders.

Change-Id: I39a04fe7797d20ffae0814809f550431b1184810
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245371
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-05-30 15:14:43 +00:00
Johnni Winther 9ff6a58790 [cfe] Add initial support for macro precompilation in incremental compiler
Change-Id: I340694cb6aac2ac8305f71caf7897eef09ebfa5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235460
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-09 22:14:05 +00:00
Johnni Winther 7d115ed0ad [cfe] Move macro tests to common subfolder
Change-Id: I3c327744e6e76d99efa7fc44644542ea92e5a0d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235225
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-08 14:17:23 +00:00
Johnni Winther cae6c75023 [cfe] Remove unused scanner/parser suites
Change-Id: I9051f449dec5773b47a489d260275cbecce9a31e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234281
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-01 14:40:39 +00:00
Jens Johansen 1044d83ab7 [kernel] Spell check kernel/bin
Change-Id: I1433d7940f9a20b70793c8e0ea801d16aa3f9eb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231201
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-02-02 12:20:46 +00:00
Johnni Winther 9b7be8d117 [cfe] Call MacroExecutor for phase 3 macros
This CL adds capability for calling MacroExecutor to apply phase 3
macros to function declarations.

Change-Id: I1ab5bf33c8d9c6ce0c6706fe2bcafe2298ff292b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/227720
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-01-17 16:24:55 +00:00
Johnni Winther 078d407f40 [cfe] Add modular_suite
This adds a new expectation test suite which mimics the modular
compilation strategy used by dartdevc; the test code is fully compiled
but the linked dependencies are only compiled as outlines.

Change-Id: I4b8a68087997c025eb39aec414ee1706ddf7f847
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222762
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2021-12-10 14:02:30 +00:00
Jens Johansen ad6ffaab95 [CFE] First stab at prototype for textually extracting outlines
Change-Id: Ib84b47f0acb553cee6d891d7bbcf865f4a57a65a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221080
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-11-26 06:14:44 +00:00
Johnni Winther 6f59892b82 [cfe] Add initial test for macros
This test mimics the macro builder system currently in development
and tests declared and applied macros can be recognized through the
generated AST.

Change-Id: Ide47def2b6044d74051a090879f49ba4a3c8d201
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220763
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-11-22 11:17:53 +00:00
Johnni Winther d906c6de26 Reland "[cfe] Move createLibraryBuilder methods to loaders"
This is a reland of 0e7d0f5205

Original change's description:
> [cfe] Move createLibraryBuilder methods to loaders
>
> Change-Id: I912ab0494cc91a4a2b665a24a7d55362402542ff
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216940
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Jens Johansen <jensj@google.com>

Change-Id: Ibb25413423a9bbd67c8788f9adce95c201ac8ebf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217603
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-10-21 14:24:06 +00:00
Johnni Winther 3006908d7e Revert "[cfe] Encapsulate Dill/SourceLoader.builders" and "[cfe] Move createLibraryBuilder methods to loaders"
This reverts commits 2bbb5dc907 and 0e7d0f5205.

Change-Id: I140ae6eab70102d39b1bec665bedd3a3dbfb02bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217300
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-10-19 23:14:11 +00:00
Alexander Thomas 056afdac39 [testing] Merge dart2js-batch into the global batch option
* Remove all uses of `--dart2js-batch`.
* Enable batch mode for dart2js by default.
* Rename `--noBatch` to `--no-batch`.
* Make `--no-batch` affect dart2js configurations.

Change-Id: I33bdb5cfe8a82ccfc6ce9e43843f1b7a34ff1fbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217006
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2021-10-19 13:49:02 +00:00
Johnni Winther 0e7d0f5205 [cfe] Move createLibraryBuilder methods to loaders
Change-Id: I912ab0494cc91a4a2b665a24a7d55362402542ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216940
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-10-15 06:13:07 +00:00
Nate Bosch f9c68a5679 Replace a bunch of references to .packages
Most of these arguments are flowing through to a `--packages` argument
which allows passing the `package_config.json` file. In the long term we
should remove the `.packages` file entirely.

TEST=None, the change should have no visible impact.

Change-Id: I60a8b175d5e217a85588bbcb91cc5095514066b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211503
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-10-12 20:16:15 +00:00
Jens Johansen 5b5956bd4e [CFE] First pass at internal test utility
This is a first pass at running inlined tests
(seemingly called doctests in for instance python) on internal CFE code.

This is not useful for testing the entire compiler for instance, but
could be useful for utility methods that take simple inputs and provide
simple outputs.

I've added tests to a few tings to try it out.

The syntax for it here is probably overly verbose but we could iterate
on that if need be.

The way it's done is that the test-code is extracted from the comments
and (virtually) "injected" in a weirdly named top level method of the
same file, which is then called from a "fake" main; the whole thing is
compiled to dill and run in an isolate.
(This is an application where making advanced invalidation support
adding top level methods would be great).

Change-Id: I7927822bca0ba68780458c40fe585882330e3b60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203242
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-06-22 08:12:58 +00:00
Jens Johansen 8a03e9e75f [parser] Create parser equivalence test suite for ensuring that files parse 'the same'
This CL creates a new test suite running through *.equivalence_info
(yaml) files where one specifies a number of files that are supposed to
parse 'the same' in the sense that it gives 'the same' listener events
modulo whatever the yaml file specifies is ok is not the same.
This could for instance - and is in the tests added here - be to not
include data after the parenthesis (as it often includes tokens),
ignoring `handleParenthesizedExpression` (as for instance `a < b` and
`(a < b)` should probably parse the same and ignoring
`handleRecoverableError`.

This might be a bit basic, but as future needs come up we can make this
fit our needs.

Change-Id: I4f5dfde9e916a95742f49e104fb5c751a8a9b921
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197381
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-05-05 10:17:22 +00:00
Jens Johansen 20cfdeffe5 [CFE] Include .crash_dart in weak tests; better handling of erroneous -D parameters and expectationFileMismatchSerialized on -DupdateExpectations=true
Change-Id: I00da3e4cf8859c65a8d93600804c7dbc56ec0bca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192180
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-19 13:34:17 +00:00
Johnni Winther 03ac05b146 [kernel] Migrate package:kernel/text_serializer.dart
Change-Id: I0b084911fa4ba35593a70ba8c214e818dbf7c219
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190440
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-03-10 13:26:58 +00:00
Johnni Winther 357e83e44d [cfe] Rename incremental_load/initialize_from_dill(_suite) to incremental(_suite)
Change-Id: I747151249330ed3c9c1026289be52d5ca0dca891
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185600
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-19 08:41:07 +00:00
Johnni Winther 045a40d2e6 [cfe] Rename incremental_suite to incremental_dartino_suite
- to prepare for renaming incremental_load/initialize_from_dill to
  incremental

Change-Id: Ie47f8e46c90b61de0838a83dcc9a5be6d866aa19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185547
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-19 08:41:07 +00:00
Johnni Winther 821536f7a3 [cfe] Remove general_nnbd_opt_out
The folder 'general' now tests the same. Two tests unique to
general_nnbd_opt_out have been copied over to general.

Change-Id: Ibd02dc236cdddff0730fb99bf10504dd16329cab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185545
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-19 08:41:07 +00:00
Johnni Winther 667be21ae3 [cfe] Remove old sharding of suites.
Suites are now sharded through unit_test_suites.

Change-Id: Ifa810f9b7031d109ed85da012220cbea44c10245
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185541
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-19 08:41:07 +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
Sigmund Cherem 912005267d [web] rename suite dart2js -> web.
Change-Id: I46be49b2effec3e38a3dc44cd45cfe736f77fa78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182680
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-02-04 23:11:32 +00:00
Jens Johansen 30ae8e3d14 [CFE] Rename tests that require git; split unit_test_suites; filter tests better
This CL is a warm-up to a follow-up change that will make running the
CFE trybot faster.
This CL:
* Rename tests that require git (because when working with filesets
  and shards in the test system, the "checkout" is not a git checkout
  and git commands thus doesn't work properly.
* Filters the front-end unit test setup on the front-end bot the way
  it was probably intended, i.e. run tests in pkg/kernel, pkg/front_end
  and pkg/fasta (actually, the last one doesn't exist, but still)
  instead of just in folders inside the "suite" 'pkg' that somewhere in
  the path has something called 'kernel', 'front_end' or 'fasta'.
* Split unit_test_suites.dart into a "forwarding shell" and a impl.
  In a follow-up CL the impl will be converted to nnbd to allow for
  using 'required' on named parameters, but if the entry point was
  nnbd it would run in sound nnbd mode and nothing would compile
  because all imports are not nnbd.

Overall this CL should change very little, mostly just run a few less
tests, i.e. for instance skip tests that live inside a folder called
'fasta' somewhere inside the analyzer directory path.

Change-Id: I3226c7261cff8b68cc287cff07dc1715dfd85159
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181381
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-01-28 07:46:10 +00:00
Johnni Winther fabf3efda4 [cfe] Refactor ClassHierarchyBuilder to use Tuple for computation
Change-Id: I8055552313786814bde6f66214a013a8bedb2078
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177500
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-01-19 19:52:13 +00:00
Johnni Winther f7ae22a4c1 Reland "[cfe] Improve encoding of set/list literals for unified collections"
Change-Id: I4f8098e110c9a5e5d6e102b8c6230e85c1575c6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175040
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-04 09:52:20 +00:00
Johnni Winther 48ae906dc4 Revert "[cfe] Improve encoding of set/list literals for unified collections"
This reverts commit 3380168c76.

Reason for revert: Performance regression on VM

Original change's description:
> [cfe] Improve encoding of set/list literals for unified collections
>
> Closes #44188
>
> Change-Id: Ib7d457f4beef0f7284922803d46cfe5d4b14cb1d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173268
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>

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

Change-Id: If61882f73e59d0d61a2c23bd28179a881545d295
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173541
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-23 16:00:08 +00:00
Johnni Winther 3380168c76 [cfe] Improve encoding of set/list literals for unified collections
Closes #44188

Change-Id: Ib7d457f4beef0f7284922803d46cfe5d4b14cb1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173268
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-23 11:21:33 +00:00
Johnni Winther b38821f39d [kernel] Enforce lints in pkg/kernel
Change-Id: I954f7632f22b552febed2a3140f81245277cb050
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171581
Reviewed-by: Jens Johansen <jensj@google.com>
2020-11-11 12:51:28 +00:00
Johnni Winther 1d6eac5ebf [cfe] Only use experimental release version when flag is not on by default
Change-Id: I06267c6d3f0e5abb289e25fde8098aa0e3bead34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166844
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-10-12 12:57:41 +00:00
Jens Johansen d69a2110ef [CFE] Remove old dill test, suit etc.
This is no longer necessary with the VM only supporting the latest
version and kernel (optionally) including a git-checksum to match up
VM and dills.

Change-Id: Ifccfd0d12333cd99258100cda30e1536cc230bc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166024
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-10-05 12:52:49 +00:00
Jens Johansen 3a1f732c0f [parser] Make begin/end events always come in pairs
This CL:
* Changes the events so beginX and endX events always comes in pairs
  (though technically not right as some specific events can be beginX
  endY --- but in those cases it is at least documented and used in code
  that actually tests it).
  -> This entails adding some events and converting something from
    "beginX" to "handleX" instead.
* Adds a utility that can generate an AST of sorts directly from the
  parser via a listener using the begin/end matching (and knowing of the
  specific ones that doesn't match directly).
* Adds a test that checks that - at least for all tested (50,000+) files
  - the AST actually generate "correctly", i.e. matches up begin/ends
  and ends up with a single top entry "CompilationUnit".
* Adds a different visualization to the parser listener events by
  displaying the "AST directly from the parser" in a UI that can be
  navigated. The visualization may not be the best, but it's certainly
  a stepping stone.

Change-Id: I9b27f7bbf3be442adc92f357c7b3c46da6f84cf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159664
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-01 09:30:43 +00:00
Johnni Winther 082295a61e [cfe] Support lowering of static fields with initializers
This adds support lowering the encoding of top-level/static fields
with initializers as if they were marked as late fields. This ensures
that LateInitialization is thrown if final fields are written to during
initialization.

Closes #42956

Change-Id: I488fdddd87ebd935a0cdaf82a724e9b87d5f91ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160724
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-09-01 07:20:58 +00:00
Jens Johansen ad85cdf71c [CFE] Add _fe_analyzer_shared to CFE's 'analyze' test
This should have avoided
https://dart-review.googlesource.com/c/sdk/+/150220

Change-Id: I638084ab1e1a6b53441e0c98a824f3cd1f56ef78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150361
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-06-09 06:28:37 +00:00
Joshua Litt 451694e855 [dart2js] Move dart2js_native to dart2js/native.
Change-Id: I2f879fe18376b8c1b82fc201d488425dc154d2b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149341
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-06-04 18:11:49 +00:00
Joshua Litt 05ca544f15 [dart2js] Move tests/compiler/dart2js_extra to tests/dart2js_2.
Change-Id: Iaa0ca2b4f2d1b15f79ddca37834d3ed2497bc068
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149242
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-06-03 15:15:30 +00:00
Johnni Winther 6708394f03 [cfe] Add predicates to detect late lowered fields.
Needed for https://github.com/dart-lang/sdk/issues/41892

Change-Id: I049e76655cf62a5558c18319e80ab9702c7a3c22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148321
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-05-19 08:55:20 +00:00
Johnni Winther c10b41a4e2 [kernel] Add DartType.toTypeText and Constant.toConstantText
These are used to provide a testable textual representation
of types and constants that do not rely upon Node.toString.

Change-Id: Iff77ebb44e8299b262f4f263666b2e1d4dd5794b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147909
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-05-18 11:48:20 +00:00
Johnni Winther 00353040b9 [CFE] Error when strong mode mixed with non-opted-in
Change-Id: Ibff34fe071a6d10ce29c30e1d008d4a5ce6690a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140868
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-05-14 17:10:51 +00:00
Jens Johansen 64714f2596 [CFE] Include _fe_analyzer_shared in tests
Change-Id: I6d2ab3465a0aa2488cbe7b9a2f1909ab6c615d32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147082
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-05-11 13:13:21 +00:00