Remove invalid inequal tear-off hash code test

`hashCode` requires that equal objects have the same hash code.

However it doesn't (and cannot) require that inequal objects have
different hash codes. Remove the invalid check.

This makes the test pass on dart2wasm, which currently implements
closure hash code as:

    // Simple hash code for now, we can optimize later
    @override
    int get hashCode => runtimeType.hashCode;

Note: this change alone does not make the whole file pass with
dart2wasm, there's another (unrelated) issue which will be fixed
separately.

Change-Id: Ibc83aee13fdbe48d1b2f7d8e720766b455c6b930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286783
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
This commit is contained in:
Ömer Sinan Ağacan 2023-03-03 11:07:50 +00:00 committed by Commit Queue
parent cc736dfb65
commit 8dbf923e89

View file

@ -21,7 +21,6 @@ tearoffEquals(f1, f2) {
tearoffNotEquals(f1, f2) {
Expect.notEquals(f1, f2);
Expect.notEquals(f1.hashCode, f2.hashCode);
}
testDynamic() {