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

Side by Side Diff: pkg/front_end/testcases/reorder_super.dart

Issue 2993193002: When reordering constructor initializers, use correct types for temp vars. (Closed)
Patch Set: Created 3 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
OLDNEW
(Empty)
1 // Copyright (c) 2017, 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 // This test verifies that super calls get reordered properly. It exercises the
6 // case where the arguments to super have a type other than `dynamic`.
7 String events = '';
8
9 int f(x) {
10 events += 'f($x)\n';
11 return 0;
12 }
13
14 String g(x) {
15 events += 'g($x)\n';
16 return 'foo';
17 }
18
19 class B {
20 num x;
21 String y;
22 B(this.x, this.y) {
23 events += 'super($x, $y)\n';
24 }
25 }
26
27 class C extends B {
28 final z;
29 C()
30 : super(f(1), g(2)),
31 z = f(3);
32 }
33
34 main() {
35 new C();
36 if (events != 'f(1)\ng(2)\nf(3)\nsuper(0, foo)\n') {
37 throw 'Unexpected sequence of events: $events';
38 }
39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698