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

Side by Side Diff: tests/language_strong/super_field_test.dart

Issue 2571363002: fixes #27385, implement virtual fields in DDC (Closed)
Patch Set: format Created 4 years 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
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Dart test for testing super field access. 4 // Dart test for testing super field access.
5 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7 import "package:meta/meta.dart" show virtual;
8 8
9 class A { 9 class A {
10 A() { 10 A() {
11 city = "Bern"; 11 city = "Bern";
12 } 12 }
13 String greeting() { 13 String greeting() {
14 return "Gruezi"; 14 return "Gruezi";
15 } 15 }
16 String city; 16 @virtual String city;
17 } 17 }
18 18
19 19
20 class B extends A { 20 class B extends A {
21 B() : super() {} 21 B() : super() {}
22 String greeting() { 22 String greeting() {
23 return "Hola " + super.greeting(); 23 return "Hola " + super.greeting();
24 } 24 }
25 } 25 }
26 26
(...skipping 22 matching lines...) Expand all
49 Expect.equals("Bern", b.city); 49 Expect.equals("Bern", b.city);
50 Expect.equals("Basel Bern", c.city); 50 Expect.equals("Basel Bern", c.city);
51 c.city = "Zurich"; 51 c.city = "Zurich";
52 Expect.equals("Basel Zurich", c.city); 52 Expect.equals("Basel Zurich", c.city);
53 } 53 }
54 } 54 }
55 55
56 main() { 56 main() {
57 SuperFieldTest.testMain(); 57 SuperFieldTest.testMain();
58 } 58 }
OLDNEW
« no previous file with comments | « tests/language_strong/super_field_2_test.dart ('k') | tests/language_strong/type_promotion_closure_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698