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

Side by Side Diff: tests/language/abstract_exact_selector_test.dart

Issue 158733003: Fix language tests wrt. warnings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix tests and status. Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/abstract_factory_constructor_test.dart » ('j') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Regression test for dart2js that used to duplicate some `Object` 5 // Regression test for dart2js that used to duplicate some `Object`
6 // methods to handle `noSuchMethod`. 6 // methods to handle `noSuchMethod`.
7 7
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 import "compiler_annotations.dart"; 9 import "compiler_annotations.dart";
10 10
11 abstract class Foo { 11 abstract /// 01: static type warning
12 class Foo {
12 noSuchMethod(im) => 42; 13 noSuchMethod(im) => 42;
13 } 14 }
14 15
15 @DontInline() 16 @DontInline()
16 returnFoo() { 17 returnFoo() {
17 (() => 42)(); 18 (() => 42)();
18 return new Foo(); 19 return new Foo();
19 } 20 }
20 21
21 class Bar { 22 class Bar {
22 operator==(other) => false; 23 operator==(other) => false;
23 } 24 }
24 25
25 var a = [false, true, new Object(), new Bar()]; 26 var a = [false, true, new Object(), new Bar()];
26 27
27 main() { 28 main() {
28 if (a[0]) { 29 if (a[0]) {
29 // This `==` call will make the compiler create a selector with an 30 // This `==` call will make the compiler create a selector with an
30 // exact `TypeMask` of `Foo`. Since `Foo` is abstract, such a call 31 // exact `TypeMask` of `Foo`. Since `Foo` is abstract, such a call
31 // cannot happen, but we still used to generate a `==` method on 32 // cannot happen, but we still used to generate a `==` method on
32 // the `Object` class to handle `noSuchMethod`. 33 // the `Object` class to handle `noSuchMethod`.
33 print(returnFoo() == 42); 34 print(returnFoo() == 42);
34 } else { 35 } else {
35 Expect.isFalse(a[2] == 42); 36 Expect.isFalse(a[2] == 42);
36 } 37 }
37 } 38 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/abstract_factory_constructor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698