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

Unified Diff: lib/compiler/implementation/elements/elements.dart

Issue 10916172: num implements Comparable and Hashable. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
Index: lib/compiler/implementation/elements/elements.dart
===================================================================
--- lib/compiler/implementation/elements/elements.dart (revision 12025)
+++ lib/compiler/implementation/elements/elements.dart (working copy)
@@ -1550,13 +1550,17 @@
return new SourceString('operator\$$str');
}
- static bool isStringSupertype(Element element, Compiler compiler) {
+ static bool isNumberOrStringSupertype(Element element, Compiler compiler) {
LibraryElement coreLibrary = compiler.coreLibrary;
return (element == coreLibrary.find(const SourceString('Comparable')))
- || (element == coreLibrary.find(const SourceString('Hashable')))
- || (element == coreLibrary.find(const SourceString('Pattern')));
+ || (element == coreLibrary.find(const SourceString('Hashable')));
}
+ static bool isStringOnlySupertype(Element element, Compiler compiler) {
+ LibraryElement coreLibrary = compiler.coreLibrary;
+ return element == coreLibrary.find(const SourceString('Pattern'));
+ }
+
static bool isListSupertype(Element element, Compiler compiler) {
LibraryElement coreLibrary = compiler.coreLibrary;
return (element == coreLibrary.find(const SourceString('Collection')))

Powered by Google App Engine
This is Rietveld 408576698