| Index: sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart
|
| ===================================================================
|
| --- sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart (revision 27131)
|
| +++ sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart (working copy)
|
| @@ -263,15 +263,26 @@
|
|
|
| bool operator==(other) {
|
| if (identical(this, other)) return true;
|
| +
|
| + bool containsAll() {
|
| + return other.disjointMasks.every((e) {
|
| + var map = disjointMasks.map((e) => e.nonNullable());
|
| + return map.contains(e.nonNullable());
|
| + });
|
| + }
|
| +
|
| return other is UnionTypeMask
|
| + && other.isNullable == isNullable
|
| && other.disjointMasks.length == disjointMasks.length
|
| - && other.disjointMasks.every((e) => disjointMasks.contains(e));
|
| + && containsAll();
|
| }
|
|
|
| int get hashCode {
|
| - int hashCode = 43;
|
| + int hashCode = isNullable ? 86 : 43;
|
| + // The order of the masks in [disjointMasks] must not affect the
|
| + // hashCode.
|
| for (var mask in disjointMasks) {
|
| - hashCode = (hashCode ^ mask.hashCode) & 0x3fffffff;
|
| + hashCode = (hashCode ^ mask.nonNullable().hashCode) & 0x3fffffff;
|
| }
|
| return hashCode;
|
| }
|
|
|