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

Unified Diff: sdk/lib/core/comparable.dart

Issue 2959443002: Make Comparable.compare generic.
Patch Set: Created 3 years, 6 months 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
« no previous file with comments | « no previous file | tests/corelib_strong/list_sort_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/comparable.dart
diff --git a/sdk/lib/core/comparable.dart b/sdk/lib/core/comparable.dart
index 7a22948a080fabb5649088b32bcfc4499fcb89c2..449d5ea3b8b10bccb23e762eb1615c26399eefa8 100644
--- a/sdk/lib/core/comparable.dart
+++ b/sdk/lib/core/comparable.dart
@@ -90,5 +90,5 @@ abstract class Comparable<T> {
* This utility function is used as the default comparator
* for ordering collections, for example in the [List] sort function.
*/
- static int compare(Comparable a, Comparable b) => a.compareTo(b);
+ static int compare<T extends Comparable<T>>(T a, T b) => a.compareTo(b);
}
« no previous file with comments | « no previous file | tests/corelib_strong/list_sort_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698