Increase the strictness of our requiring explicit types (#7585)

...now that we have generic methods, their types need to be specified too.
This commit is contained in:
Ian Hickson
2017-01-23 01:04:31 -08:00
committed by GitHub
parent 99822088a7
commit 63aa1397a3
63 changed files with 134 additions and 127 deletions

View File

@@ -34,7 +34,7 @@ void main() {
applyMocksToCommand(command);
return createTestCommandRunner(command).run(
<String>['analyze', '--no-current-package', '--no-current-directory', dartFileA.path, dartFileB.path]
).then((_) {
).then<Null>((Null value) {
expect(testLogger.statusText, startsWith('Analyzing 2 files...\nNo analyzer warnings!'));
});

View File

@@ -118,7 +118,7 @@ void main() {
notifyingLogger: notifyingLogger
);
commands.add(<String, dynamic>{'id': 0, 'method': 'daemon.shutdown'});
return daemon.onExit.then((int code) {
return daemon.onExit.then<Null>((int code) {
responses.close();
commands.close();
expect(code, 0);

View File

@@ -1,3 +1,3 @@
analyzer:
exclude:
exclude:
- '**'

View File

@@ -1,3 +1,3 @@
analyzer:
exclude:
exclude:
- '**'

View File

@@ -268,7 +268,7 @@ class MockVMService extends BasicMock implements VMService {
String fsName = request.headers.value('dev_fs_name');
String devicePath = UTF8.decode(BASE64.decode(request.headers.value('dev_fs_path_b64')));
messages.add('writeFile $fsName $devicePath');
request.drain().then((_) {
request.drain<List<int>>().then<Null>((List<int> value) {
request.response
..write('Got it')
..close();

View File

@@ -47,13 +47,13 @@ void main() {
targetDeviceFinder = () {
throw 'Unexpected call to targetDeviceFinder';
};
appStarter = (_) {
appStarter = (DriveCommand command) {
throw 'Unexpected call to appStarter';
};
testRunner = (_) {
testRunner = (List<String> testArgs) {
throw 'Unexpected call to testRunner';
};
appStopper = (_) {
appStopper = (DriveCommand command) {
throw 'Unexpected call to appStopper';
};
});
@@ -86,14 +86,14 @@ void main() {
testUsingContext('returns 1 when app fails to run', () async {
withMockDevice();
appStarter = expectAsync((_) async => 1);
appStarter = expectAsync((DriveCommand command) async => 1);
String testApp = '/some/app/test_driver/e2e.dart';
String testFile = '/some/app/test_driver/e2e_test.dart';
MemoryFileSystem memFs = memoryFileSystem;
await memFs.file(testApp).writeAsString('main() {}');
await memFs.file(testFile).writeAsString('main() {}');
await memFs.file(testApp).writeAsString('main() { }');
await memFs.file(testFile).writeAsString('main() { }');
List<String> args = <String>[
'drive',
@@ -155,14 +155,14 @@ void main() {
String testApp = '/some/app/test/e2e.dart';
String testFile = '/some/app/test_driver/e2e_test.dart';
appStarter = expectAsync((_) {
appStarter = expectAsync((DriveCommand command) {
return new Future<int>.value(0);
});
testRunner = expectAsync((List<String> testArgs) {
expect(testArgs, <String>[testFile]);
return new Future<int>.value(0);
});
appStopper = expectAsync((_) {
appStopper = expectAsync((DriveCommand command) {
return new Future<int>.value(0);
});
@@ -186,13 +186,13 @@ void main() {
String testApp = '/some/app/test/e2e.dart';
String testFile = '/some/app/test_driver/e2e_test.dart';
appStarter = expectAsync((_) {
appStarter = expectAsync((DriveCommand command) {
return new Future<int>.value(0);
});
testRunner = (_) {
testRunner = (List<String> testArgs) {
throwToolExit(null, exitCode: 123);
};
appStopper = expectAsync((_) {
appStopper = expectAsync((DriveCommand command) {
return new Future<int>.value(0);
});