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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/tests/compiler/dart2js/find_my_name_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 void main() { 5 // This checks that it is possible to have a method named negate as
6 var foo = new Foo(); 6 // well as unary- operator.
7 var bar = new Bar(); /// 01: compile-time error 7
8 class Foo {
9 operator-() => 42;
10 negate() => 87;
8 } 11 }
9 12
10 class Foo { 13 main() {
11 factory Foo() => null; 14 Expect.equals(42, -new Foo());
15 Expect.equals(87, new Foo().negate());
12 } 16 }
13
14 class Bar extends Foo {
15 Bar(); /// 01: continued
16 }
OLDNEW
« 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