Usually we have good information from the nullability graph about why
we need to insert a cast, but sometimes we don't. For example, when a
cast needs to be inserted because NNBD doesn't allow implicit
downcasts, we often can't give any additional information beyond "a
cast is needed here now".
We allow info to be null in these cases to avoid an assertion failure.
Fixes https://github.com/dart-lang/sdk/issues/40533.
Change-Id: I7639374f92820faf04bda2aeda96d0e38f07e8d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135161
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
There were two problems:
1. An info object isn't being properly passed to
NodeChangeForExpression, causing an assertion failure during the
FixAggregator stage. I've modified the assertion check so that it
happens earlier, during the FixBuilder, so that the exception is
caught by permissive mode logic and doesn't cause a hard crash.
I'll work on fixing the assertion in a follow-up CL.
2. The hack described in https://github.com/dart-lang/sdk/issues/40536
was causing a bogus assertion failure in
_PassThroughBuilderImpl._checkParenLogic. I've weakened the
assertion slightly so that for now, the hack won't cause trouble.
See the issue for more information about what's happening--this
should be cleaned up eventually but it's probably not high
priority.
Bug: https://github.com/dart-lang/sdk/issues/40533
Change-Id: Iee832fbd07e54b02d2c52f79a097ff9d973cda9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134980
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2.6 matches the versions used in the existing "// @dart=2.6" comments
in the tests, but it excludes extension methods, which we have tests
for so need to enable.
Change-Id: I816baeeb308ec0cac967b21d23eeccfb32cf1733
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134878
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
(Hard-wired paths are making tests harder to write.)
Change-Id: Ifb996e78c18cc8249b9ee0f18e6db52097778d47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
This is required when comparing functions type objects with sub-canonicalized functions.
Example:
Function() g() => (() => 0) (opt-out)
Function()? f() => null (opt-in)
both canonicalize their return type as a step in canonicalizing the entire function. Omitting a wrapper around the canonicalized function type (the return value) would result in the runtime types of these functions being canonicalized to the same value.
Change-Id: Icb1fd77458267e769bd4d4f54b71d0f81a323bd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133340
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
NoSuchMethodError._invocationType is actually always -1 which is out of
range. Before NNBD migration we had an explicit range check which helped
to avoid throwing exception, but it was replaced with assert during
migration. This CL restores the range check.
Fixes co19_2/LibTest/core/NoSuchMethodError/toString_A01_t01 with
unforked SDK.
Change-Id: I91abe92491fe3a15aa422a41fefe6538baac5621
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134875
Reviewed-by: Siva Annamalai <asiva@google.com>
dartdevc_native tests also have to be updated to not wrap/unwrap generic function types.
Change-Id: I4115db483bb6668c171ec29ca7483dfabc470df5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133285
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Sign extension of small integers is not symmetric between register arguments and register return values.
On Linux/MacOS x64, the caller is responsible for both the arguments and return value.
Previous tests only tested equality, which tests the equality of the lowest byte. However, when printing or using the small ints arithmetic all 4 bytes are used. The new tests pass back the number in a different format.
The callback tests test the number in Dart, so they did not suffer from implicit conversions. (TestTakeMaxUint8x10 in runtime/bin/ffi_test/ffi_test_functions.cc and tests/ffi_2/function_callbacks_test.dart.)
Fixes: https://github.com/dart-lang/sdk/issues/40537
Change-Id: I6a57cb7cb43206926eb101a66e3b2abfacec72a0
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-mac-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134825
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Now, when writing an AOT snapshot in bare instructions mode, only
the actual instructions in the RawInstructions payload are serialized
instead of the entire RawInstructions object.
Since there are no longer RawInstructions objects in these AOT
snapshots, we also change how Code objects are serialized. Instead
of just containing a reference to the RawInstructions object, we
serialize two pieces of information: where the instructions
payload for this Code object begins and whether there was a single
entry for the instructions payload. (To save space, the single
entry bit is serialized as the low order bit of the unchecked
offset, which was already being serialized).
While we also need the length of the instructions payload, we
approximate it for all but the last Code object by subtracting
the next Code object's payload start from this Code object's
payload start. For the last Code object, we assume it extends
to the end of the instructions image.
Changes on flutter gallery in release mode:
armv7: instructions size -2.70%, total size -1.73%
armv8: instructions size -6.04%, total size -3.63%
Fixes https://github.com/dart-lang/sdk/issues/38451.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: Ia0a5c4e5e47c956776dc62503da38ec55a143c04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134325
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This reverts commit b158bf7bd5.
Reason for revert: Changes to Class::InvokeSetter trigger failure of
ASSERT(!other.IsDynamicType()); in Instance::RuntimeTypeIsSubtypeOf.
Original change's description:
> [VM/Libraries] Turn on NNBD versions of dart:io and dart:_http libraries
>
> - Turn on NNBD versions of dart:io and dart:_http libraries
> - Fix an unimplemented section in Class::InvokeSetter
>
> Change-Id: I5343a76e62c0bacaddd9b1859bef5119d80bc5ac
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134884
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>
TBR=asiva@google.com,regis@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Id98204057ff49a28c1ad5e94f8afcdfcb8261e0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134826
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
A couple of feature specs did not explicitly say that they are now
background material and normative language should be found in specific
other places. This CL does that. It also makes the README.md even more
explicit in order to make the same point.
Change-Id: I79cbd86a662faf478ce41c01e09c5f32a3f03cd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134824
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
This reverts commit 9464eb51f5.
Reason for revert: Causes a failure in the Analyzer bot, some analysis errors.
Original change's description:
> [ DartFuzz ] Prevent generated programs from explicitly throwing OutOfMemoryError
>
> Programs generated by dartfuzz.dart explicitly look for OOM errors and
> return with a specific error code (254) to notify dartfuzz_test.dart
> that the program exited after running out of memory. If both
> configurations being tested return 254, the result for that fuzzing run
> is counted as "skipped", artificially inflating the "skipped" count.
>
> Fixes https://github.com/dart-lang/sdk/issues/40493
>
> Change-Id: I552dbd497fe514da929b08a7a523616d1d3db538
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134903
> Auto-Submit: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com
Change-Id: I23e286bb9c5aba1513fbc66bcb6d49221cbd4aba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135000
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Programs generated by dartfuzz.dart explicitly look for OOM errors and
return with a specific error code (254) to notify dartfuzz_test.dart
that the program exited after running out of memory. If both
configurations being tested return 254, the result for that fuzzing run
is counted as "skipped", artificially inflating the "skipped" count.
Fixes https://github.com/dart-lang/sdk/issues/40493
Change-Id: I552dbd497fe514da929b08a7a523616d1d3db538
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134903
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Bug: b/149075352
Event.path should call composedPath if the result of the inline is
True. As it is, it only calls it if the result is null, which is
erroneous.
Change-Id: Idacc9ccddafc4374aca10de84265bf82cfbd0ab9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134887
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Under NNBD rules, certain function literals have their types inferred
as `Object?` instead of `dynamic`. We need to add explicit `dynamic`
to prevent follow-on errors if those parameters are used in a dynamic
fashion.
Change-Id: I12bfd3a3da2bda1ae11b01a5d029dbea3d512cb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134567
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
DartType.== implementations ignore nullability if the flag is not true.
TypeSystem APIs eliminate nullability from types before doing anything.
Internally analyzer continues using actual nullability for types.
Package nnbd_migration opted into NullSafetyUnderstandingFlag.
Bug: https://github.com/dart-lang/sdk/issues/40500
Change-Id: Ifeea28c01adf1dc59ed2da675b4a62c6334d529a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134865
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This should fix all ddc isolate errors. Remaining two io/_http errors are due to:
https://github.com/dart-lang/sdk/issues/40482
The rest are mirrors. Do we think we'll be able to remove it altogether? If not,
I can take a pass to fix.
Change-Id: I4cef9773b5fa36490bdfbc08a06fae6cd80c5eae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134860
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Several of the tests were testing conditions that cannot occur and hence
were either re-written or removed. There's one test that I couldn't get
working so I marked it as failing. I marked another test as failing
rather than remove it because I think we want to update the lint to
catch that case (it's failing because no lint is produced).
Change-Id: I852c3c4595b0993ce2a64cbd9da1b6c7339dd59b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>