Move to real generic method syntax (#7235)

This commit is contained in:
Ian Hickson
2017-01-21 20:58:44 -08:00
committed by GitHub
parent 2e196037f5
commit 15a7eb3b6c
60 changed files with 154 additions and 157 deletions

View File

@@ -196,7 +196,7 @@ class FlutterDriver {
// option, then the VM service extension is not registered yet. Wait for
// it to be registered.
Future<dynamic> whenResumed = resumeLeniently();
Future<dynamic> whenServiceExtensionReady = Future.any/*<dynamic>*/(<Future<dynamic>>[
Future<dynamic> whenServiceExtensionReady = Future.any<dynamic>(<Future<dynamic>>[
waitForServiceExtension(),
// We will never receive the extension event if the user does not
// register it. If that happens time out.
@@ -452,9 +452,9 @@ class FlutterDriver {
/// With frame sync disabled, its the responsibility of the test author to
/// ensure that no action is performed while the app is undergoing a
/// transition to avoid flakiness.
Future<dynamic/*=T*/> runUnsynchronized/*<T>*/(Future<dynamic/*=T*/> action()) async {
Future<T> runUnsynchronized<T>(Future<T> action()) async {
await _sendCommand(new SetFrameSync(false));
dynamic/*=T*/ result;
T result;
try {
result = await action();
} finally {

View File

@@ -160,7 +160,7 @@ class TimelineSummary {
if (events.length == 0)
return null;
int total = events.fold/*<int>*/(0, (int t, TimedEvent e) => t + e.duration.inMilliseconds);
int total = events.fold<int>(0, (int t, TimedEvent e) => t + e.duration.inMilliseconds);
return total / events.length;
}
@@ -169,7 +169,7 @@ class TimelineSummary {
return null;
return events
.map/*<double>*/((TimedEvent e) => e.duration.inMilliseconds.toDouble())
.map<double>((TimedEvent e) => e.duration.inMilliseconds.toDouble())
.reduce((double a, double b) => math.max(a, b));
}