In error reporting on assignability where the expression has type
`Null` we use a special messages that doesn't state that
"'Null' is nullable". Cases where `Null` is part of the type or where
the expression of type `Null` is derived from a collection are not
special cased.
Closes#43998Closes#44093
Change-Id: Ic0c79e6362f2365eb3fe8222ccd2ef8fac4f188d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170433
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
The CL add a 'flags' to MethodInvocation with the properties isInvariant
and isBoundsSafe. The former is used for to marks safe calls in unified
collection encoding. Both can be used further by backends.
The CL also adds a 'fileEndOffset' to Block. This is current set for
block declared in used code.
In response to https://github.com/dart-lang/sdk/issues/43994
and https://github.com/dart-lang/sdk/issues/43965
Change-Id: I579fc2928331465dfc2c152ccfd21297b12cfdd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170695
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
The old phrasing was confusing because it was unclear which libraries
were being referred to.
Bug: https://github.com/dart-lang/sdk/issues/44061
Change-Id: Id68f28fcd8ba5a80763e7bf86d6774289701d381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170841
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
* `reference.hasElementFor` implies that `reference.element` is not null.
* Using `whereType` prevents an explicit cast from being needed.
Change-Id: I800f7183292ecd0bb6370a381b1d0b924b7f5a61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170744
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Currently `IsCurrentThreadReader()` can only be called outside
safepoint operations. We'll loosen that restriction for future CLs
which require calling this method inside safepoint operations.
Change-Id: I23a99cc535df47c1dbd41f92e29e669e7ddd921f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170685
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
A smoke test to exercise alignment of structs with various field types
to see how they are aligned on the stack. Only contains small structs
because most ABIs only pass structs less than 16 bytes on the stack.
Especially tests iOS64, where `AlignOf(struct{float32;float32;}) == 4`
but `AlignOf(struct{int32;int32;}) == 8` due to the special treatment
of homogenous floats in the arm64 ABI combined with iOS decision to not
align everything on the stack to at least word size.
Test tested on iOS64 through Flutter.
structs_by_value_tests_configuration.dart is the only non-generated
file.
The tests are tested in the dependent CL. Tests are ignored in status
file and are un-ignored in dependent CL.
Tests for https://github.com/dart-lang/sdk/issues/36730.
Change-Id: I6ec4523208db740b8ea3f8a4ab1e5717f1088467
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170691
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The added test show that we generate a super call to the wrong target
in some forwarding stubs. The target should have been the mixed in
member but is instead the super member that it overrides.
Change-Id: If7536628370ba69405cbedef969e727a5d220058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170684
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-05 irina.arkhipets@gmail.comFixes#602: New tests for least and greatest closures added.
2020-11-05 sgrekhov@unipro.ru#926. Rewrite io/Process/start_A01_t02 test to work on precompiled environment
2020-11-05 sgrekhov@unipro.ru#932. Rewrite HttpRequestUpload/onLoad_A01_t01 test to send correct HttpRequest
2020-11-04 sgrekhov@unipro.ruFixes#956. Don't expect extension invocation on type dynamic
2020-11-04 karlklose@users.noreply.github.com Convert some multi-tests to static error framework (#958)
2020-11-03 irina.arkhipets@gmail.comFixes#602: dynamic tests for least and greatest closures updated.
2020-11-03 irina.arkhipets@gmail.comFixes#602: tests for least and greatest closures added.
2020-10-28 sgrekhov@unipro.ru#926. Fix two Process tests to use 'process_test' tool
2020-10-28 sgrekhov@unipro.ru#926. Rewrite two Process tests to use 'process_test' tool
2020-10-28 sgrekhov@unipro.ruFixes#955. Expect less specific error for typed_data tests
2020-10-26 sgrekhov@unipro.ruFixes#954. Change the line where we expect an error for CFE
2020-10-20 sgrekhov@unipro.ruFixes#912. Abstract variables syntax tests added
2020-10-19 sgrekhov@unipro.ru#912. More external variables syntax tests added
2020-10-17 sgrekhov@unipro.ru External variables syntax test added
2020-10-16 sgrekhov@unipro.ru#912. More test for static analysis of external variables added
2020-10-15 sgrekhov@unipro.ru#912. Test for static analysis of external variables added
2020-10-14 sgrekhov@unipro.ru#912. Test for static analysis if abstract variables added
Cq-Include-Trybots: dart/try:analyzer-nnbd-linux-release-try,analyzer-nnbd-win-release-try,dart2js-nnbd-linux-x64-chrome-try,ddc-nnbd-linux-release-chrome-try,front-end-nnbd-linux-release-x64-try,front-end-nnbd-win-release-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-release-simarm64-try,vm-kernel-nnbd-linux-release-x64-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-win-release-x64-try
Change-Id: Id9cde784918faa4e891da8c4cb448d415a7a18aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170680
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
There is no need to call from C++ into Dart code just so the Dart code
can return a constant. Instead we can get the constant directly in C++
code.
This avoids calling into Dart code during class finalization to evaluate
enum constants.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: Ia0b09482188be2d0ce83ce9ffc20e5c15e52d070
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170540
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
The copy was accidentally removed when removing bot.py.
TEST=BUILDBOT_BUILDERNAME="debianpackage-linux-be" ./tools/run_debian_build.sh
Change-Id: I9264824246a96a83f171602571d2073243776d64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170686
Reviewed-by: William Hesse <whesse@google.com>
This includes the following pub commits:
git log --format="%C(auto) %h %s" 5b4df5a6f931c63622ac349602d6ef0367e8070f..fb72c1f774ca27556225b207185c0b6b6ab1c274
fb72c1f7 Make `run` available (but deprecated) in the embedding (#2698)
63b56ea4 Return the exit-code from commands (#2689)
7fc4e273 Deprecate top level (#2694)
Change-Id: I5842b1ecb15fc7844d628e2ad5fb00e3f627dbff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168347
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Change-Id: I64074eb4b49e514f3b7454de0fb244f21ef336a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170580
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Also lower the initial array size to save a tiny bit of memory and
let the existing tests exercise exponential growth
TEST=tests/{ffi,ffi_2}/function_callbacks_many_test.dart
Change-Id: I7b490878035cf2e2264ce7443dfdc2b342bedcc3
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170438
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Instead of running `pub outdated` to see if the user's dependencies
have been migrated yet, the migration tool now examines all of the
transitive import dependencies of the user's code to see if they are
opted in to null safety. This produces a more accurate result than
`pub outdated`, because it is able to ignore files in transitive
package dependencies that aren't reachable via imports
(e.g. references to `package:analyzer` brought in by `package:test`).
Fixes#44061.
Bug: https://github.com/dart-lang/sdk/issues/44061
Change-Id: I38465bcbf35e8552f0060b5d51c0f1cfc5d18c7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170561
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
This shows progress for work which happens after the migration suggestions have
been generated. This work is generating instrumentation details for the front
end.
When migrating the analyzer package, the progress indicated by this third
progress bar takes approximately the same time as generating suggestions (on
the same order of magnitude).
Fixes https://github.com/dart-lang/sdk/issues/44074
Change-Id: I0b40dd5e587b718bd1ef56d64f03929924cc430a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170563
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Splitting out a failing test to increase coverage of other tests.
It is not clear that `a.addAll(a)` should throw if `a` is empty.
`a` is not modified by the action.
dart2js/DDC do not detect this case and I'm reluctant to add a check
for the case where `a` is in fact not modified.
The VM test is very specific to an identical argument and cannot
detect the case for `a = Mylist([])`.
Another option to this proposal is to simply delete the `[]` case.
In general, I'd like to move more ConcurrentModificationError tests
into assert statements.
Change-Id: I1f9559bdb43ea1bae0575413748c9d9d0de58b99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170023
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Early in the development of the migration tool, due to language
versioning support being incomplete, it didn't have a good way to
distinguish opted in from opted out code, so we had the convention
that any code not being migrated was opted in. Now that we have
language versioning support, we need to explicitly opt that code in.
Without this change, we'll get bogus failures when we add logic to
detect unmigrated dependencies.
Bug: https://github.com/dart-lang/sdk/issues/44061
Change-Id: I12920ea75b8af2142a044314b89b76bb602897c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170560
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Many fields can be late or late final, so adding hints for the migration tool.
In SnippetTester, the fields are all set in the constructor. Added a factory
constructor so the fields can be final. Renamed them to be private.
Change-Id: I559e7ba92c7c6749038630b03f67f8a77bdc704a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170406
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Fields initialized in `setUp` are late.
Variables initialized with implicit casts like:
ClassDeclaration clazz = unit.declarations[0];
would need a cast:
ClassDeclaration clazz = unit.declarations[0] as ClassDeclaration;
so they are updated to use var, which is more idiomatic:
var clazz = unit.declarations[0] as ClassDeclaration;
Change-Id: I4e4ae814a814d3a4200c5078a6904dbac0a8140c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170520
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This test, it turns out, only works for these particular flags.
Any other combination of causal/lazy-async-stacks will make it break.
Change-Id: I03efa5c28f49e6bbdb9da359270a0f7eff072924
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170436
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
These types are called object types in the C standard
(ISO/IEC 9899:2011) and fundamental types in C++
(https://en.cppreference.com/w/cpp/language/types) but more commonly
they are called primitive types
(https://en.wikipedia.org/wiki/Primitive_data_type).
Change-Id: I78ac9bee162e547a7b9b04cf142b274602c53d18
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170429
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>