Skip to content

Commit 79b5240

Browse files
devoncarewCommit Queue
authored andcommitted
Update various packages based on diagnostics from strict_top_level_inference.
Change-Id: I032d10fd1956b62a9e45ceee9ca2b28c9863d1ce Tested: diagnostic updates only change Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401560 Commit-Queue: Devon Carew <[email protected]> Reviewed-by: Nate Bosch <[email protected]>
1 parent 6abaa31 commit 79b5240

File tree

21 files changed

+41
-33
lines changed

21 files changed

+41
-33
lines changed

pkg/analysis_server/lib/src/legacy_analysis_server.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ class LegacyAnalysisServer extends AnalysisServer {
524524

525525
/// There was an error related to the socket from which requests are being
526526
/// read.
527-
void error(argument) {}
527+
void error(Object argument) {}
528528

529529
/// Return the cached analysis result for the file with the given [path].
530530
/// If there is no cached result, return `null`.

pkg/analysis_server/lib/src/services/completion/postfix/postfix_completion.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,12 @@ abstract final class DartPostfixCompletion {
306306
return processor.findObjectExpression() != null;
307307
}
308308

309-
static bool _false(_) => false;
309+
static bool _false(PostfixCompletionProcessor _) => false;
310310

311-
static Future<PostfixCompletion?> _null(_, _) async => null;
311+
static Future<PostfixCompletion?> _null(
312+
PostfixCompletionProcessor _,
313+
PostfixCompletionKind _,
314+
) async => null;
312315
}
313316

314317
/// A description of a postfix completion.

pkg/analysis_server/lib/src/utilities/mocks.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class MockServerChannel implements ServerCommunicationChannel {
4747
_closed = true;
4848
}
4949

50-
void expectMsgCount({responseCount = 0, notificationCount = 0}) {
50+
void expectMsgCount({int responseCount = 0, int notificationCount = 0}) {
5151
expect(responsesReceived, hasLength(responseCount));
5252
expect(notificationsReceived, hasLength(notificationCount));
5353
}

pkg/build_integration/lib/file_system/multi_root.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class MultiRootFileSystem implements FileSystem {
3636
final List<Uri> roots;
3737
final FileSystem original;
3838

39-
MultiRootFileSystem(this.markerScheme, List roots, this.original)
39+
MultiRootFileSystem(this.markerScheme, List<Uri> roots, this.original)
4040
: roots = roots.map(_normalize).toList();
4141

4242
@override
@@ -116,7 +116,6 @@ class MissingFileSystemEntity implements FileSystemEntity {
116116
Future.error(FileSystemException(uri, 'File not found'));
117117
}
118118

119-
Uri _normalize(root) {
120-
Uri uri = root;
119+
Uri _normalize(Uri uri) {
121120
return uri.path.endsWith('/') ? uri : uri.replace(path: '${uri.path}/');
122121
}

pkg/build_integration/lib/file_system/single_root.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class SingleRootFileSystemEntity implements FileSystemEntity {
8080
Future<String> readAsString() async => delegate.readAsString();
8181
}
8282

83-
_normalize(root) {
84-
Uri uri = root;
83+
Uri _normalize(Uri uri) {
8584
return uri.path.endsWith('/') ? uri : uri.replace(path: '${uri.path}/');
8685
}

pkg/dart2js_info/bin/src/library_size_split.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class _Divider extends _Row {
213213
const _Divider() : super('', 0);
214214
}
215215

216-
String _pad(value, n, {bool right = false}) {
216+
String _pad(Object value, int n, {bool right = false}) {
217217
final s = '$value';
218218
if (s.length >= n) return s;
219219
var pad = ' ' * (n - s.length);

pkg/dart2js_info/bin/src/live_code_size_analysis.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ class LiveCodeAnalysisCommand extends Command<void> with PrintUsageException {
7575
}
7676
}
7777

78-
Future<void> _liveCodeAnalysis(infoFile, coverageFile, bool verbose) async {
78+
Future<void> _liveCodeAnalysis(
79+
String infoFile,
80+
String coverageFile,
81+
bool verbose,
82+
) async {
7983
var info = await infoFromFile(infoFile);
8084
var coverage = jsonDecode(File(coverageFile).readAsStringSync());
8185

pkg/dart2js_info/bin/tools.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import 'src/text_print.dart';
2222
import 'src/to_devtools_format.dart';
2323

2424
/// Entrypoint to run all dart2js_info tools.
25-
void main(args) {
25+
void main(List<String> args) {
2626
var commandRunner =
2727
CommandRunner(
2828
"dart2js_info",

pkg/dart2js_tools/bin/deobfuscate.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import 'package:stack_trace/stack_trace.dart';
4040
///
4141
/// The .js file must contain a `//# sourceMappingURL=` line at the end, which
4242
/// tells this script how to determine the name of the source-map file.
43-
main(List<String> args) {
43+
void main(List<String> args) {
4444
if (args.length != 1) {
4545
print('usage: deobfuscate.dart <stack-trace-file>');
4646
exit(1);
@@ -87,7 +87,7 @@ main(List<String> args) {
8787
final green = stdout.hasTerminal ? '\x1b[32m' : '';
8888
final none = stdout.hasTerminal ? '\x1b[0m' : '';
8989

90-
printPadded(String mapping, String? original, sb) {
90+
void printPadded(String mapping, String? original, sb) {
9191
var len = mapping.length;
9292
var s = mapping.indexOf('\n');
9393
if (s >= 0) len -= s + 1;

pkg/dart2js_tools/bin/lookup_name.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'dart:io';
44
import 'package:dart2js_tools/src/dart2js_mapping.dart';
55
import 'package:dart2js_tools/src/util.dart';
66

7-
main(List<String> args) {
7+
void main(List<String> args) {
88
if (args.length < 2) {
99
print('usage: read.dart <source-map-file> <name>');
1010
exit(1);

0 commit comments

Comments
 (0)