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

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

Issue 22999005: Make analyzer happy and use annotations the right way. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 | « tests/language/language_analyzer.status ('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) 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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "compiler_annotations.dart"; 6 import "compiler_annotations.dart";
7 7
8 var a = [null]; 8 var a = [null];
9 9
10 class A { 10 class A {
11 var foo; 11 var foo;
12 var bar; 12 var bar;
13 13
14 @DontInline 14 @DontInline()
15 A() { 15 A() {
16 // Currently defeat inlining by using a closure. 16 // Currently defeat inlining by using a closure.
17 bar = () => 42; 17 bar = () => 42;
18 foo = 42; 18 foo = 42;
19 foo = a[0]; 19 foo = a[0];
20 } 20 }
21 } 21 }
22 22
23 class B { 23 class B {
24 var foo; 24 var foo;
25 var bar; 25 var bar;
26 26
27 @DontInline 27 @DontInline()
28 B() { 28 B() {
29 // Currently defeat inlining by using a closure. 29 // Currently defeat inlining by using a closure.
30 bar = () => 42; 30 bar = () => 42;
31 foo = 42; 31 foo = 42;
32 foo = a[0]; 32 foo = a[0];
33 if (false) foo = 42; 33 if (false) foo = 42;
34 } 34 }
35 } 35 }
36 36
37 main() { 37 main() {
38 // Surround the call to [bar] by allocations of [A] and [B] to 38 // Surround the call to [bar] by allocations of [A] and [B] to
39 // ensure their constructors get analyzed first. 39 // ensure their constructors get analyzed first.
40 new A(); 40 new A();
41 new B(); 41 new B();
42 bar(); 42 bar();
43 new A(); 43 new A();
44 new B(); 44 new B();
45 } 45 }
46 46
47 @DontInline 47 @DontInline()
48 bar() { 48 bar() {
49 // Currently defeat inlining by using a closure. 49 // Currently defeat inlining by using a closure.
50 Expect.throws(() => new A().foo + 42, (e) => e is NoSuchMethodError); 50 Expect.throws(() => new A().foo + 42, (e) => e is NoSuchMethodError);
51 Expect.throws(() => new B().foo + 42, (e) => e is NoSuchMethodError); 51 Expect.throws(() => new B().foo + 42, (e) => e is NoSuchMethodError);
52 } 52 }
OLDNEW
« no previous file with comments | « tests/language/language_analyzer.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698