add missing type parameter on methods (#22096)

This commit is contained in:
Alexandre Ardhuin
2018-10-01 21:29:08 +02:00
committed by GitHub
parent 48fb726b01
commit f62afdcf57
211 changed files with 504 additions and 503 deletions

View File

@@ -33,7 +33,7 @@ void main() {
MockProcess Function(List<String>) processMetaFactory(List<String> stdout) {
final Stream<List<int>> stdoutStream = Stream<List<int>>.fromIterable(
stdout.map((String s) => s.codeUnits));
stdout.map<List<int>>((String s) => s.codeUnits));
return (List<String> command) => MockProcess(stdout: stdoutStream);
}

View File

@@ -24,7 +24,7 @@ void main() {
test('returns root context in child of root zone if zone was manually created', () {
final Zone rootZone = Zone.current;
final AppContext rootContext = context;
runZoned(() {
runZoned<void>(() {
expect(Zone.current, isNot(rootZone));
expect(Zone.current.parent, rootZone);
expect(context, rootContext);
@@ -61,7 +61,7 @@ void main() {
final AppContext rootContext = context;
await rootContext.run<void>(name: 'child', body: () {
final AppContext childContext = context;
runZoned(() {
runZoned<void>(() {
expect(context, isNot(rootContext));
expect(context, same(childContext));
expect(context.name, 'child');
@@ -79,7 +79,7 @@ void main() {
String value;
await context.run<void>(
body: () {
outer.future.then((_) {
outer.future.then<void>((_) {
value = context[String];
inner.complete();
});

View File

@@ -73,7 +73,7 @@ void main() {
testUsingContext('printStatus should log to stdout when logToStdout is enabled', () async {
final StringBuffer buffer = StringBuffer();
await runZoned(() async {
await runZoned<Future<void>>(() async {
final StreamController<Map<String, dynamic>> commands = StreamController<Map<String, dynamic>>();
final StreamController<Map<String, dynamic>> responses = StreamController<Map<String, dynamic>>();
daemon = Daemon(
@@ -228,7 +228,7 @@ void main() {
daemon.deviceDomain.addDeviceDiscoverer(discoverer);
discoverer.addDevice(MockAndroidDevice());
return await responses.stream.skipWhile(_isConnectedEvent).first.then((Map<String, dynamic> response) async {
return await responses.stream.skipWhile(_isConnectedEvent).first.then<void>((Map<String, dynamic> response) async {
expect(response['event'], 'device.added');
expect(response['params'], isMap);

View File

@@ -159,7 +159,7 @@ void main() {
pubOutput,
pluginRegistrants,
pluginWitnesses,
].expand((List<String> list) => list);
].expand<String>((List<String> list) => list);
for (String path in allFiles) {
final File file = fs.file(fs.path.join(projectPath, path));
if (file.existsSync())
@@ -285,7 +285,7 @@ void main() {
final Future<Null> simulateUserInput = Future<Null>(() {
mockStdio.simulateStdin('y');
});
await Future.wait(<Future<Null>>[runPackages, runPrompt, simulateUserInput]);
await Future.wait<Null>(<Future<Null>>[runPackages, runPrompt, simulateUserInput]);
final List<String> commands = mockProcessManager.commands;
expect(commands, hasLength(2));
expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));

View File

@@ -127,7 +127,7 @@ class FlutterTestDriver {
// Proxy the stream/sink for the VM Client so we can debugPrint it.
final StreamChannel<String> channel = IOWebSocketChannel.connect(_vmServiceWsUri)
.cast<String>()
.changeStream((Stream<String> stream) => stream.map(_debugPrint))
.changeStream((Stream<String> stream) => stream.map<String>(_debugPrint))
.changeSink((StreamSink<String> sink) =>
StreamController<String>()
..stream.listen((String s) => sink.add(_debugPrint(s))));
@@ -282,7 +282,7 @@ class FlutterTestDriver {
Future<VMInstanceRef> evaluateExpression(String expression) async {
final VMFrame topFrame = await getTopStackFrame();
return _timeoutWithMessages(() => topFrame.evaluate(expression),
return _timeoutWithMessages<VMInstanceRef>(() => topFrame.evaluate(expression),
message: 'Timed out evaluating expression ($expression)');
}
@@ -334,7 +334,7 @@ class FlutterTestDriver {
}
});
return _timeoutWithMessages(() => response.future,
return _timeoutWithMessages<Map<String, dynamic>>(() => response.future,
timeout: timeout,
message: event != null
? 'Did not receive expected $event event.'
@@ -406,5 +406,5 @@ class FlutterTestDriver {
}
Stream<String> _transformToLines(Stream<List<int>> byteStream) {
return byteStream.transform(utf8.decoder).transform(const LineSplitter());
return byteStream.transform<String>(utf8.decoder).transform<String>(const LineSplitter());
}

View File

@@ -85,7 +85,7 @@ void testUsingContext(String description, dynamic testMethod(), {
body: () {
final String flutterRoot = getFlutterRoot();
return runZoned(() {
return runZoned<Future<dynamic>>(() {
try {
return context.run<dynamic>(
// Apply the overrides to the test context in the zone since their
@@ -198,7 +198,7 @@ class MockDoctor extends Doctor {
/// the Doctor.
List<DoctorValidator> get validators {
final List<DoctorValidator> superValidators = super.validators;
return superValidators.map((DoctorValidator v) {
return superValidators.map<DoctorValidator>((DoctorValidator v) {
if (v is AndroidValidator) {
return MockAndroidWorkflowValidator();
}

View File

@@ -303,8 +303,8 @@ class MockStdio extends Stdio {
_stdin.add(utf8.encode('$line\n'));
}
List<String> get writtenToStdout => _stdout.writes.map(_stdout.encoding.decode).toList();
List<String> get writtenToStderr => _stderr.writes.map(_stderr.encoding.decode).toList();
List<String> get writtenToStdout => _stdout.writes.map<String>(_stdout.encoding.decode).toList();
List<String> get writtenToStderr => _stderr.writes.map<String>(_stderr.encoding.decode).toList();
}
class MockPollingDeviceDiscovery extends PollingDeviceDiscovery {