| Index: dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| index 4f619ce409d95af65fd427461bbbb1af53082e63..b741eb9e38b562ddecfa5c4a813be9e6c0b0fcbd 100644
|
| --- a/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| +++ b/dart/sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
| @@ -778,6 +778,7 @@ class ResolverTask extends CompilerTask {
|
| } else if (isBinaryOperator(value)) {
|
| messageKind = MessageKind.BINARY_OPERATOR_BAD_ARITY;
|
| requiredParameterCount = 1;
|
| + if (identical(value, '==')) checkOverrideHashCode(member);
|
| } else if (isTernaryOperator(value)) {
|
| messageKind = MessageKind.TERNARY_OPERATOR_BAD_ARITY;
|
| requiredParameterCount = 2;
|
| @@ -788,6 +789,17 @@ class ResolverTask extends CompilerTask {
|
| checkArity(function, requiredParameterCount, messageKind, isMinus);
|
| }
|
|
|
| + void checkOverrideHashCode(FunctionElement operatorEquals) {
|
| + if (operatorEquals.isAbstract(compiler)) return;
|
| + ClassElement cls = operatorEquals.getEnclosingClass();
|
| + Element hashCodeImplementation =
|
| + cls.lookupLocalMember(const SourceString('hashCode'));
|
| + if (hashCodeImplementation != null) return;
|
| + compiler.reportHint(
|
| + operatorEquals, MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE,
|
| + {'class': cls.name.slowToString()});
|
| + }
|
| +
|
| void checkArity(FunctionElement function,
|
| int requiredParameterCount, MessageKind messageKind,
|
| bool isMinus) {
|
| @@ -2236,7 +2248,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| sendIsMemberAccess = oldSendIsMemberAccess;
|
|
|
| if (target != null && target == compiler.mirrorSystemGetNameFunction) {
|
| - compiler.reportWarningCode(
|
| + compiler.reportHint(
|
| node.selector, MessageKind.STATIC_FUNCTION_BLOAT,
|
| {'class': compiler.mirrorSystemClass.name,
|
| 'name': compiler.mirrorSystemGetNameFunction.name});
|
| @@ -2656,7 +2668,7 @@ class ResolverVisitor extends MappingVisitor<Element> {
|
| }
|
| }
|
| } else {
|
| - compiler.reportWarningCode(
|
| + compiler.reportHint(
|
| node.newToken, MessageKind.NON_CONST_BLOAT,
|
| {'name': compiler.symbolClass.name});
|
| world.registerNewSymbol(mapping);
|
|
|