Index: dart/tests/compiler/dart2js/resolver_test.dart |
diff --git a/dart/tests/compiler/dart2js/resolver_test.dart b/dart/tests/compiler/dart2js/resolver_test.dart |
index dcdcc070919b5386c606a65aee86a8e0d309f712..1902d65337bc1f47e60112c9a5bfa401ddc7c280 100644 |
--- a/dart/tests/compiler/dart2js/resolver_test.dart |
+++ b/dart/tests/compiler/dart2js/resolver_test.dart |
@@ -74,6 +74,7 @@ main() { |
testToString(); |
testIndexedOperator(); |
testIncrementsAndDecrements(); |
+ testOverrideHashCodeCheck(); |
} |
testTypeVariables() { |
@@ -845,3 +846,22 @@ testIncrementsAndDecrements() { |
checkMemberResolved(compiler, 'C', operatorName('-', false)); |
checkMemberResolved(compiler, 'D', operatorName('-', false)); |
} |
+ |
+testOverrideHashCodeCheck() { |
+ final script = r""" |
+ class A { |
+ operator==(other) => true; |
+ } |
+ class B { |
+ operator==(other) => true; |
+ get hashCode => 0; |
+ } |
+ main() { |
+ new A() == new B(); |
+ }"""; |
+ final compiler = compileScript(script); |
+ Expect.equals(1, compiler.warnings.length); |
+ Expect.equals(MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE, |
+ compiler.warnings[0].message.kind); |
+ Expect.equals(0, compiler.errors.length); |
+} |