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

Unified Diff: dart/tests/language/operator_negate_and_method_negate_test.dart

Issue 10905211: Clean up operator names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 1 month 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 | « dart/tests/compiler/dart2js/find_my_name_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/language/operator_negate_and_method_negate_test.dart
diff --git a/dart/tests/compiler/dart2js_extra/regress/4562_test.dart b/dart/tests/language/operator_negate_and_method_negate_test.dart
similarity index 51%
copy from dart/tests/compiler/dart2js_extra/regress/4562_test.dart
copy to dart/tests/language/operator_negate_and_method_negate_test.dart
index 13a30edc8c3407cf7ed64d28819af3d7d6149172..83a19e42c5b55803ba8722de8059363948b135b4 100644
--- a/dart/tests/compiler/dart2js_extra/regress/4562_test.dart
+++ b/dart/tests/language/operator_negate_and_method_negate_test.dart
@@ -2,15 +2,15 @@
// 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.
-void main() {
- var foo = new Foo();
- var bar = new Bar(); /// 01: compile-time error
-}
+// This checks that it is possible to have a method named negate as
+// well as unary- operator.
class Foo {
- factory Foo() => null;
+ operator-() => 42;
+ negate() => 87;
}
-class Bar extends Foo {
- Bar(); /// 01: continued
+main() {
+ Expect.equals(42, -new Foo());
+ Expect.equals(87, new Foo().negate());
}
« no previous file with comments | « dart/tests/compiler/dart2js/find_my_name_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698