The following analyzer hints are fixed:
hint • This function has a return type of 'String', but doesn't end with a return statement at pkg/vm/bin/compare_sizes.dart:140:3 • missing_return
hint • This function has a return type of 'String', but doesn't end with a return statement at pkg/vm/bin/compare_sizes.dart:198:3 • missing_return
Change-Id: Ia34006eb023c0b3f9b60f8f38dc248cfa1c87a30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98983
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Noteworthy that this issue was flagged by an attempt to convert flutter (https://github.com/flutter/flutter/pull/30784). Specifically, the assist here was throw a Bad Element exception:
set fakeResults(Map<String, List<ProcessResult>> value) {
_fakeResults = <String, List<ProcessResult>>{};
for (String key in value.keys) {
_fakeResults[key] = <ProcessResult>[]
..addAll(value[key] ?? <ProcessResult>[ProcessResult(0, 0, '', '')]);
}
}
Change-Id: Icec80f14160cf9ba28a4e8e39935f469e762b39f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98985
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
This CL adds the following new members to NullabilityNode:
- A `debugSuffix` getter, to retrieve a string representation of a
nullability node for debugging test failures.
- An `isAlwaysNullable` getter, to determine whether a NullabilityNode
is known, by construction, to always be nullable.
- An `isNullable` getter, to determine whether constraint solving
assigned the nullability node to be nullable.
With these new members, the two constraint variables inside the
NullabilityNode class (`nullabile` and `_nonNullIntent`) are only
referred to from within the NullabilityNode class itself, and in
tests.
Change-Id: I0f51aa2834a885fb13c6bbfe7d68cd517b65724a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98982
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This change adds option --protobuf-tree-shaker to enable protobuf tree
shaker transformation in gen_kernel and Fuchsia kernel compiler.
Protobuf tree shaker requires closed world and only works with --aot
and --tfa.
Change-Id: I9fcc7934624f2d11f9b04215f1a81367f8ec82e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98781
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
The code that accomplishes this is non-obvious (it relies on the fact
that we use the same constraint variable to track the nullability of
such parameters as to track their optional-ness), so it's worth having
specific tests for.
Change-Id: Ia2ccfca6ffe3f8050f14b3849e80a0e721cc143f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98961
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
With this CL, the NullabilityNode class is now used for the following
purposes:
- In ConditionalDiscard, to keep track of when branches of "if"
statements should be discarded.
- To track the nullability relationships implied by an assignment.
- To track the nullability implied by an optional parameter that lacks
a default value.
- In _ConditionInfo, to keep track of how assert statements imply
non-null intent.
Change-Id: Ieb05bb569258a3d16720c127a3f6038f805304c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
context: the package_root logic is not portable to how we run this test outside
the sdk in other build systems like bazel. To make it work in bazel, we
currently use const.fromEnvironment to override the location of the package
root. Due to upcoming changes to constant evaluation we can't continue using
const.fromEnvironment.
I considered 3 other options:
* using Platform.environment
* changing platform_root to be more sophisticated (e.g. look for a folder
containing `test`, instead of looking for `pkg`)
* directly defining the root at the beginning of main based on Platform.script
The latter works out of the box in bazel and is also pretty simple, so I felt it
was a good choice.
Note: there are several other tests depending on package_root that we can update
in a similar fashion. Today this is the only test that depends on package_root
that we are running internally in bazel.
Change-Id: Ie7b79a82c78605048b26b9676eac2fbd8b15aaa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98879
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
modern mixins
* Remove AbstractStrongTest.enableNewAnalysisDriver; it is always true.
* Add Element.hasOptionalTypeArgs, which requires changing
AbstractStrongTest to use PackageMixin and PackageMapUriResolver,
instead of the custom _TestUriResolver.
Change-Id: Iecb6e37ed5894d42ad965022a8c52e3b5f625655
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
The old constructor, which simply wrapped a ConstraintVariable, is now
private.
This is another step toward removing ConstraintVariables from the
migration tool entirely.
Change-Id: Ieb4be5b76711aaede5ca56871d52ff3b19c18d70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98941
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The .getStaticType results for NullLiteral and NullConstant are inconsistent. The former returns `const BottomType()` and the latter return `TypeEnvironment.nullType`.
To avoid this inconsistency and since `const BottomType()` is really the "unreachable" type, used for instance of for the type of a throw expression, the implementation is changed to consistently use the .nullType.
For this to work, getStaticTypeAsInstanceOf (and the equivalent dart2js implementation), and the `Type.fromStaticType` constructor in the VM type flow analysis have to special case the .nullType.
Change-Id: If6b806d4a39ef7b906275c43fa2089b9d140523b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98563
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This reverts commit 1ad11facec.
Reason for revert: The CL broke the flutter-analyze bot.
Original change's description:
> Fix mustCallSuper for mixins and inherited interfaces:
>
> * If a method overrides a mixed in @mustCallSuper method, it should call super.
> * If a method overrides a method from a supertype, which itself overrides a
> method from an interface, the first method should call super.
>
> Fixes internal b/70374204.
>
> Change-Id: I645de4a288a8c5ffff173e97692f8eb6fe38bdb5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98443
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
TBR=brianwilkerson@google.com,srawlins@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I9339e6a8933f6d25b3bcbdbac0b6a1d304a3693b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98803
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>