Splits strong_test into 4 shards. This test took 4+ minutes locally with
the fast_strong_test and analyze_test ticking in at ~1:45. This change
makes local testing of frontend unittests take 2 instead of 4 minutes in
total.
Change-Id: Id6015de86d547b209a699b1e5196b3edad1e6977
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114501
Reviewed-by: Jens Johansen <jensj@google.com>
Dart allows the last switch case to "fall through" the end of the
switch statement. To account for this, we previously required the
caller of FlowAnalysis to calling `handleBreak` at the end of the last
switch case. (In the analyzer implementation we actually only did
this if the last case was a `default` case, but in practice there was
no observable difference).
This CL shifts the responsibility to FlowAnalysis to handle this
scenario; the caller only needs to call `handleBreak` if there is an
actual break statement present.
Change-Id: Ia0d7abb21d78205f1050873e28b30cddc5fbe344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114547
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Responsibility for deciding whether to cancel promotions has been
moved to FlowAnalysis (previously the caller decided). This should
reduce the risk of the analyzer and front end behaviors diverging.
Also removed an unnecessary argument from
FlowAnalysis.switchStatement_end.
Change-Id: Ib015e4e360e62da7bb267057e4626acaa94e9e74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114541
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
- deprecates 'target' on LibraryBuilder, ClassBuilder, ExtensionBuilder,
TypeAliasBuilder, and TypeVariableBuilder.
- prepares for deprecation of 'target' on MemberBuilder,
VariableBuilder, and FormalParameterBuilder
Change-Id: Ic04c533eb5443c7b7c6413e48f399450d1ebe43a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113440
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Previously the client was required to create a synthetic `true`
literal. The client may still do that (it's equivalent), but it's no
longer necessary.
Change-Id: Iffa12769b542678dab6cd4b5583d7058b41aebd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114342
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
We already have an analyzer test in CFE, but because that test also
includes for instance everything that imports the front_end, kernel or
testing, we had to disable lints in that one.
This CL adds an analyzer test for CFE sorces onlyi where lints are
enabled.
Change-Id: Ic58c8c6e92f4a7962bbf5489a37f2bf95a5c095b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114067
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Add a lint to discourage importing the same file more than once.
The idea being that it was probably done by mistake (e.g. automatically
by an editor).
This is done in a number of places and they are currently added to the
status file.
Change-Id: I16bc9c04c5a607f87ead1fb34922a7edb408c3da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113985
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This CL:
* adds a test that runs the VM with old dills (compilations of dart2js
with old checkouts) with the --compile_all argument (1).
* adds a number of old dills (for binary version 25, 27, 28, 29)
(by mistake binary version 26 sort of didn't really happen)
* adds a PRESUBMIT check in kernel that verifies that we have an
"old dill" for the current binary version, so one don't bump the
version without creating a new dill.
(1): It uses --compile_all to force the VM to "read and understand"
everything in the dill file. The hope being that we try out
all/most language constructs and thus verifies that they can be
read by the VM.
Old "old dill" files should be removed once the VM stops supporting that
version. That is a manual process, but a test should complain that the VM
cannot read the old "old dill"(s) once/if that happens.
This should (help) detect errors such as the one recently where a merge
error caused a single "if >= 28" (that should have been "if >= 29" and
thus stopped the VM from reading dills from version 28) to slip through
and require a lot of debugging a few days later.
Change-Id: Id79e16c7ad896c0ccc4e181465b05b67822ac31a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113698
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Language versioning specifies that an empty-name-entry in .packages
specifies a sort of "default package" that a non-package file should
pretend to be a part of "for any purpose where that matters,
including choosing the default language level."
Change-Id: I16f4b2f5e4d3ca1e82d2189321e2be5c43e3b260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112089
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Add support for the `late` modifier on fields and local variables in
CFE, and `required` on named parameters When using the option
--enable-experiment=non-nullable the `isLate` and `isRequired` flags will be set
accordingly on Field and VariableDeclaration nodes.
Closes#37686Closes#37684
Change-Id: If37fc93defdabc5cc974f3f068f57752a665f4cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113036
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Runs a number of tests that are quick, currently:
* Messages test in a new fast mode which skips compilation
* The spelling tests
* The custom CFE lint test
Change-Id: I7b444e5be1cf2397d6d776aac96dd7c2ad2b302d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113320
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This will make it easier to integrate flow analysis into the migration
tool, since the migration tool has a shared code path for handling
`&&` and `||`.
Change-Id: Ibf1c7362dfeaab505a2ecf7298b2569a40fca781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113038
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This CL adds a test (lint_test.dart) that gives errors if using e.g.
"var foo = 42;".
We opted to not use the lint "always_specify_types" as that does
more than what the team voted for.
Change-Id: Ia37066ee04ff676d15f41222751557a9245f953f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113032
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>