Skip to content

Commit f008738

Browse files
mralephcommit-bot@chromium.org
authored andcommitted
[vm/tests] Fix NNBD version of vm/dart/v8_snapshot_profile_writer_test
Dart type inference does not propagate type sideways in the argument lists[1], so we have to explicitly provide fold with a type argument, otherwise it is inferred as `Object?`, which does not work in this case. [1] dart-lang/language#731 Change-Id: I2ee0bda2cd6c37c64018efd48ea14c469f76ba3a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152003 Reviewed-by: Martin Kustermann <[email protected]> Commit-Queue: Vyacheslav Egorov <[email protected]>
1 parent 6bdf55f commit f008738

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

runtime/tests/vm/dart/v8_snapshot_profile_writer_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ test(
122122
// shallow sizes of all objects in the profile. They will not be exactly
123123
// equal because of global headers and padding.
124124
final actual = await File(strippedPath).length();
125-
final expected = profile.nodes.fold(0, (size, n) => size + n.selfSize);
125+
final expected = profile.nodes.fold<int>(0, (size, n) => size + n.selfSize);
126126

127127
final bareUsed = useBare ? "bare" : "non-bare";
128128
final fileType = useAsm ? "assembly" : "ELF";

runtime/tests/vm/dart_2/v8_snapshot_profile_writer_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ test(
122122
// shallow sizes of all objects in the profile. They will not be exactly
123123
// equal because of global headers and padding.
124124
final actual = await File(strippedPath).length();
125-
final expected = profile.nodes.fold(0, (size, n) => size + n.selfSize);
125+
final expected = profile.nodes.fold<int>(0, (size, n) => size + n.selfSize);
126126

127127
final bareUsed = useBare ? "bare" : "non-bare";
128128
final fileType = useAsm ? "assembly" : "ELF";

0 commit comments

Comments
 (0)