Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(835)

Unified Diff: pkg/dev_compiler/tool/input_sdk/lib/math/rectangle.dart

Issue 2407913002: Stop using unittest in point_test and rectangle_test. (Closed)
Patch Set: Fix cast in the input_sdk. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dev_compiler/test/not_yet_strong_tests.dart ('k') | pkg/dev_compiler/tool/sdk_expected_errors.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/lib/math/rectangle.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/math/rectangle.dart b/pkg/dev_compiler/tool/input_sdk/lib/math/rectangle.dart
index 6fe20755c258697a2ecda9e43b4a709bd73c83ae..bae6602cd76970e0ae838d9e93e0f4bd71ea83ab 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/math/rectangle.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/math/rectangle.dart
@@ -40,8 +40,15 @@ abstract class _RectangleBase<T extends num> {
bool operator ==(other) {
if (other is !Rectangle) return false;
- return left == other.left && top == other.top && right == other.right &&
- bottom == other.bottom;
+ // TODO(rnystrom): Type promotion doesn't currently promote the [other]
+ // to Rectangle from the above line, so do it explicitly here to avoid a
+ // dynamic send and work around:
+ // https://github.com/dart-lang/sdk/issues/27551
+ var otherRect = other as Rectangle;
+ return left == otherRect.left &&
+ top == otherRect.top &&
+ right == otherRect.right &&
+ bottom == otherRect.bottom;
}
int get hashCode => _JenkinsSmiHash.hash4(left.hashCode, top.hashCode,
« no previous file with comments | « pkg/dev_compiler/test/not_yet_strong_tests.dart ('k') | pkg/dev_compiler/tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698