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

Unified Diff: dart/tests/compiler/dart2js/mock_compiler.dart

Issue 17588005: Warn about overriding operator== but not hashCode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
Index: dart/tests/compiler/dart2js/mock_compiler.dart
diff --git a/dart/tests/compiler/dart2js/mock_compiler.dart b/dart/tests/compiler/dart2js/mock_compiler.dart
index 1e9a79603e8e27ecccc28817b659301dccb319fa..2c95decc336df079d153f90e2151f5f83c7de8a4 100644
--- a/dart/tests/compiler/dart2js/mock_compiler.dart
+++ b/dart/tests/compiler/dart2js/mock_compiler.dart
@@ -96,6 +96,7 @@ const String DEFAULT_INTERCEPTORSLIB = r'''
class Interceptor {
toString() {}
bool operator==(other) => identical(this, other);
+ get hashCode => throw "Interceptor.hashCode not implemented.";
noSuchMethod(im) { throw im; }
}
abstract class JSIndexable {
@@ -137,6 +138,7 @@ const String DEFAULT_INTERCEPTORSLIB = r'''
operator <(other) => true;
operator <=(other) => true;
operator ==(other) => true;
+ get hashCode => throw "JSNumber.hashCode not implemented.";
abs() => (this is JSInt) ? 42 : 42.0;
remainder(other) => (this is JSInt) ? 42 : 42.0;
@@ -147,6 +149,7 @@ const String DEFAULT_INTERCEPTORSLIB = r'''
}
class JSNull extends Interceptor {
bool operator==(other) => identical(null, other);
+ get hashCode => throw "JSNull.hashCode not implemented.";
}
class JSBool extends Interceptor implements bool {
}
@@ -174,6 +177,7 @@ const String DEFAULT_CORELIB = r'''
class String implements Pattern {}
class Object {
operator ==(other) { return true; }
+ get hashCode => throw "Object.hashCode not implemented.";
String toString() { return null; }
noSuchMethod(im) { throw im; }
}

Powered by Google App Engine
This is Rietveld 408576698