Tests in the folder "non-nnbd" are run in non-nnbd mode.
Change-Id: I27c2acec93f729b76f024f12dcfb84f31903e0b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124688
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
When implemention the incremental serializer, I forgot to pass it on in
the incremental kernel generators "IncrementalKernelGenerator.fromComponent"
and only did it in "IncrementalKernelGenerator", meaning that when using
"IncrementalKernelGenerator.fromComponent" the incremental serializer wasn't
used properly, namely nothing got invalidated.
Now it gets passed correctly, things get invalidated and everything should
be fine.
Fixes https://github.com/flutter/flutter/issues/44384.
Change-Id: Ic2e7f7330dc6ee62dd8e7bf6684d7bee8ee328bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124684
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This change allow builds to succeed on Arch Linux with python 2.7, 3.7.4
and 3.8. Otherwise it fails with python 3.7.4 and 3.8.
- bin_to_assembly.py
Using ord(byte) here is an error on python 3.x use a conditional
expression instead.
- create_archive.py
Using ord(byte) here is an error on python 3.x use a conditional
expression instead.
Use `as inst` syntax which is required by 3.x
- create_string_literal.py
- gen_library_src_paths.py
Use `as inst` syntax which is required by 3.x
- make_version.py
print >> sys.stderr syntax is not supported by 3.x use file=sys.stderr
and add `from __future__ import print_function`
vmhash.update requires a string use encode('utf-8')
versopm+cc+text.replace requires a str so use `decode`.
Test: No added tests as there are no behavioral changes.
Change-Id: Id9b0a3187d06ad2b2dce3cf2244144393caddc9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124211
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Saves 0.05% on CM. Should be slightly faster too - fewer tokens to
parse.
Change-Id: I9ce674525817e215e868a616729a465a60b8ef20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124468
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Adds tests for the change to make extension members accessible even
for prefixed imports. Also tests that it is an error to import a
library with extensions as deferred without hiding the extensions.
Change-Id: I3a81c560694d34c8adbb4cc86ca9e6b8a129ae56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124589
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
* Treat the assertion condition offset as a character offset in the file.
* Allow unrecognized characters to be replaced by a placeholder character. This
is unrelated to the fix but is just a precautionary measure.
Fixed: 39271
Change-Id: I4871ea41d3a46d26ecac5047265a1dbc1c889350
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124602
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Passing nullability rather than forcing kLegacy helps slightly reduce the number
of Types in the VM and in snapshots.
This allows to remove the kludge about declaration type of Null being kNullable.
Also pass nullability when creating a simple type may help.
Note that CFE is still producing super types and some interface types that are
non-nullable, even with nnbd features disabled. But this should get fixed and
further reduce the number of types in the snapshot.
Change-Id: I397f00902026ee5bc91d36328f4156427702efdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124480
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Types should have never been used here in the first place.
And with nullability we get mismatches where type parameters are used
with a suffix :-(
Change-Id: I93ff61ee9bf32c24cdf3d2aadeb23cbb84b34cfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This is to reduce load on Android benchmarking hardware.
Change-Id: Ib51b3fbbe2bf66cb0ba17375062a747f37284299
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124600
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
A core assumption of the migration tool is that the code being
migrated may have some dependencies that have already been migrated
(e.g. the SDK itself). Of course these dependencies will need to be
analyzed as "opted in" libraries so that they can have nullability
annotations.
However, when the migration tool was first being developed, we didn't
yet have a migrated SDK, so the SDK was opted out and we just had to
pretend that it was opted in.
This CL prepares to switch over to a truly opted-in SDK by updating
the AlreadyMigratedCodeDecorator to handle opted-in code.
Change-Id: I797752401f8c7bf7cdf8d26d03d00d3d213a5127
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124466
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The only optional parameter that was actually used was
nullabilitySuffix, so eliminate the others, and make it a named
parameter for easier future expansion.
Change-Id: Iee05e955a1c996b4e1dd9bbec3db7fd1588ebe04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124001
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Previously, when the code being migrated referred to a nullable or a
non-nullable type in an already-migrated library, we would use the
`always` or `never` graph node to represent the nullability of the
type. This was problematic, because it made it difficult for
instrumentation to pinpoint precisely which element in an
already-migrated library was the cause of an expresion being
null-checked, or a type being made non-nullable.
We now create a fresh nullability node for each non-nullable type
coming from already-migrated code, with an edge to `always` or `never`
to ensure that the fresh node has the correct nullability, so that
instrumentation can see precisely which element it came from.
Since the migration tool doesn't traverse the ASTs of already-migrated
code, we can't report an AST node that caused such an edge, so an
`element` getter has been added EdgeOriginInfo to allow us to report
the element that caused the edge.
As before, types associated with already-migrated code are reported to
instrumentation via InstrumentationListener.externalDecoratedType. As
a new enhancement, bounds of generic parameters in already-migrated
code are reported to instrumentation via
InstrumentationListener.externalDecoratedTypeParameterBound.
Change-Id: Ided4e96e2920f8d9062688f5a6fda29b9b71dd12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
This change allows to run test.dart and pkg/test_runner with multiple arguments
for the -n option to run tests for multiple configurations with one invocation.
Change-Id: If62e0bfc364460fa415c7f700f7e449b0de56987
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122395
Commit-Queue: Karl Klose <karlklose@google.com>
Reviewed-by: William Hesse <whesse@google.com>
This is needed for the next D27 release.
Change-Id: I199ac701cb140dc84bb723d232c1b408088b1fe2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124469
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
We now print the error code as well as the message, which makes it
easier to locate the analyzer code related to the error.
Change-Id: I9e18744ce8e58efe6a5ecb7e7a98035777982836
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124381
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The proper behavior of null-shorting relies on proper pairing between
FlowAnalysis.nullAwareAccess_rightBegin (called upon reaching a `?.`
during resolution) and FlowAnalysis.nullAwareAccess_end (called upon
reaching the termiation of null-shorting during resolution).
Previously, we ensured that invariant by the following mechanism: when
visiting an expression that might terminate null-shorting, we would
walk backward through the expression to try to figure out how many
outstanding `?.`s it contains, and call
FlowAnalysis.nullAwareAccess_end an appropriate number of times. This
was fragile because we had to guarantee that the backward walk would
find exactly the correct set of `?.`s for which null-shorting was
open.
With this change, we ensure proper pairing between
FlowAnalysis.nullAwareAccess_rightBegin and
FlowAnalysis.nullAwareAccess_end by keeping a stack of the expressions
that should terminate null-shorting once we finish visiting them.
Additionally, we add an accessor to the API called
`nullShortingTermination`, allowing a client to ask when the null
shorting introduced by a `?.` will terminate.
Change-Id: I8ec99e6bad7605d50ef3a6bc6c11634ece5043a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
specialization.
This change also adds plumbing so that we can access the kernel logic
for instantiation-to-bounds. This allows us to emit the `instanceof`
is-test specialization when all type arguments are at bounds.
Change-Id: I73cdcaeb1984d31761ddb9a5765e5bd0f29d06ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124206
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>