Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: pkg/analyzer/test/src/task/strong/strong_test_helper.dart

Issue 1442883003: generic method type parameter inference (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/src/task/strong/strong_test_helper.dart
diff --git a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
index 330801f07f1f3f92c7a761a9ab9b4f7683810665..7393909780be3c57df1274929788c8bdd47a2219 100644
--- a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
+++ b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
@@ -370,6 +370,7 @@ class _MockSdkSource implements Source {
throw new UnsupportedError('not expecting relative urls in dart: mocks');
}
+// TODO(jmesserly): can we reuse the same mock SDK as Analyzer tests?
Brian Wilkerson 2015/11/19 00:10:17 I certainly hope so! We control both.
/// Sample mock SDK sources.
final Map<String, String> mockSdkSources = {
// The list of types below is derived from:
@@ -419,8 +420,10 @@ final Map<String, String> mockSdkSources = {
const Object proxy = const _Proxy();
class Iterable<E> {
- fold(initialValue, combine(previousValue, E element)) {}
- Iterable map(f(E element)) {}
+ Iterable/*<R>*/ map/*<R>*/(/*=R*/ f(E e));
+
+ /*=R*/ fold/*<R>*/(/*=R*/ initialValue,
+ /*=R*/ combine(/*=R*/ previousValue, E element));
}
class List<E> implements Iterable<E> {
List([int length]);
@@ -434,8 +437,9 @@ final Map<String, String> mockSdkSources = {
class Future<T> {
Future(computation()) {}
Future.value(T t) {}
- Future then(onValue(T value)) {}
- static Future<List> wait(Iterable<Future> futures) {}
+ static Future<List/*<T>*/> wait/*<T>*/(
+ Iterable<Future/*<T>*/> futures) => null;
+ Future/*<R>*/ then/*<R>*/(/*=R*/ onValue(T value)) => null;
}
class Stream<T> {}
''',
@@ -448,8 +452,8 @@ final Map<String, String> mockSdkSources = {
class Random {
bool nextBool() {}
}
- num min(num x, num y) {}
- num max(num x, num y) {}
+ num/*=T*/ min/*<T extends num>*/(num/*=T*/ a, num/*=T*/ b) => null;
+ num/*=T*/ max/*<T extends num>*/(num/*=T*/ a, num/*=T*/ b) => null;
''',
};

Powered by Google App Engine
This is Rietveld 408576698