blob: 535153ad0ee8a228c63680b66f3b055d6502ab5b [file] [log] [blame]
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// test w/ `pub run test -N hash_and_equals`
class Bad {
final int value;
Bad(this.value);
@override
bool operator ==(Object other) => other is Bad && other.value == value; //LINT
}
class Bad2 {
final int value;
Bad2(this.value);
@override
int get hashCode => value.hashCode; //LINT
}
class Better //OK!
{
final int value;
Better(this.value);
@override
bool operator ==(Object other) => other is Better && other.value == value;
@override
int get hashCode => value.hashCode;
}
class OK {}