fixes to anticipate next Dart linter release (#127211)
The upcoming linter release notices null literals as unnecessary argument values and flags more `type_literal_in_constant_pattern` cases. See breakages: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8780744067138629361/+/u/analyze_flutter_flutter/stdout
This commit is contained in:
@@ -114,7 +114,7 @@ class StdoutHandler {
|
||||
}
|
||||
}
|
||||
if (message.length <= messageBoundaryKey.length) {
|
||||
compilerOutput?.complete(null);
|
||||
compilerOutput?.complete();
|
||||
return;
|
||||
}
|
||||
final int spaceDelimiter = message.lastIndexOf(' ');
|
||||
@@ -809,7 +809,7 @@ class DefaultResidentCompiler implements ResidentCompiler {
|
||||
// when outputFilename future is not completed, but stdout is closed
|
||||
// process has died unexpectedly.
|
||||
if (_stdoutHandler.compilerOutput?.isCompleted == false) {
|
||||
_stdoutHandler.compilerOutput?.complete(null);
|
||||
_stdoutHandler.compilerOutput?.complete();
|
||||
throwToolExit('the Dart compiler exited unexpectedly.');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -184,7 +184,7 @@ class CustomDevicePortForwarder extends DevicePortForwarder {
|
||||
// a port forwarding failure and we complete with a null value.
|
||||
unawaited(process.exitCode.whenComplete(() {
|
||||
if (!completer.isCompleted) {
|
||||
completer.complete(null);
|
||||
completer.complete();
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
@@ -368,7 +368,7 @@ void main() {
|
||||
await FakeAsync().run((FakeAsync time) {
|
||||
unawaited(FakeAsyncCrashingDoctor(time, logger).diagnose(verbose: false).then((bool r) {
|
||||
expect(r, isFalse);
|
||||
completer.complete(null);
|
||||
completer.complete();
|
||||
}));
|
||||
time.elapse(const Duration(seconds: 1));
|
||||
time.flushMicrotasks();
|
||||
|
||||
@@ -176,12 +176,12 @@ void main() {
|
||||
caughtByHandler = true;
|
||||
}
|
||||
if (!completer.isCompleted) {
|
||||
completer.complete(null);
|
||||
completer.complete();
|
||||
}
|
||||
}, (Object e, StackTrace s) {
|
||||
caughtByZone = true;
|
||||
if (!completer.isCompleted) {
|
||||
completer.complete(null);
|
||||
completer.complete();
|
||||
}
|
||||
}));
|
||||
time.elapse(const Duration(seconds: 1));
|
||||
@@ -214,12 +214,12 @@ void main() {
|
||||
caughtByHandler = true;
|
||||
}
|
||||
if (!completer.isCompleted) {
|
||||
completer.complete(null);
|
||||
completer.complete();
|
||||
}
|
||||
}, (Object e, StackTrace s) {
|
||||
caughtByZone = true;
|
||||
if (!completer.isCompleted) {
|
||||
completer.complete(null);
|
||||
completer.complete();
|
||||
}
|
||||
}));
|
||||
time.elapse(const Duration(seconds: 1));
|
||||
@@ -252,12 +252,12 @@ void main() {
|
||||
caughtByHandler = true;
|
||||
}
|
||||
if (!completer.isCompleted) {
|
||||
completer.complete(null);
|
||||
completer.complete();
|
||||
}
|
||||
}, (Object e, StackTrace s) {
|
||||
caughtByZone = true;
|
||||
if (!completer.isCompleted) {
|
||||
completer.complete(null);
|
||||
completer.complete();
|
||||
}
|
||||
}));
|
||||
time.elapse(const Duration(seconds: 1));
|
||||
@@ -292,12 +292,12 @@ void main() {
|
||||
caughtByHandler = true;
|
||||
}
|
||||
if (!completer.isCompleted) {
|
||||
completer.complete(null);
|
||||
completer.complete();
|
||||
}
|
||||
}, (Object e, StackTrace s) {
|
||||
caughtByZone = true;
|
||||
if (!completer.isCompleted) {
|
||||
completer.complete(null);
|
||||
completer.complete();
|
||||
}
|
||||
}));
|
||||
time.elapse(const Duration(seconds: 1));
|
||||
|
||||
@@ -126,7 +126,7 @@ void main() {
|
||||
packageConfig: PackageConfig.empty,
|
||||
packagesPath: '.packages',
|
||||
);
|
||||
stdoutHandler.compilerOutput?.complete(null);
|
||||
stdoutHandler.compilerOutput?.complete();
|
||||
completer.complete();
|
||||
|
||||
expect(await output, null);
|
||||
|
||||
Reference in New Issue
Block a user