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

Powered by Google App Engine
This is Rietveld 408576698