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

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

Issue 140803002: Perform override and inheritance checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
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 class A {
6 get getter1 => null; /// 01: ok
7 num get getter2 => null; /// 02: ok
8 num get getter3 => null; /// 03: ok
9 int get getter4 => null; /// 04: ok
10 int get getter5 => null; /// 05: static type warning
11 int get getter6 => null; /// 06: ok
12 int get getter7 => null; /// 07: static type warning
13 int get getter8 => null; /// 08: static type warning
14
15 set setter1(_) => null; /// 21: ok
16 void set setter2(_) {} /// 22: ok
17 set setter3(_) => null; /// 23: ok
18 set setter4(_) => null; /// 24: ok
19 set setter5(num _) => null; /// 25: ok
20 set setter6(num _) => null; /// 26: ok
21 set setter7(int _) => null; /// 27: ok
22 set setter8(int _) => null; /// 28: static type warning
23 set setter9(int _) => null; /// 29: ok
24 set setter10(int _) => null; /// 30: static type warning
25 set setter11(int _) => null; /// 31: static type warning
26
27 int field1; /// 41: ok
28 num field2; /// 42: ok
29 int field3; /// 43: ok
30 int field4; /// 44: static type warning
31 int field5; /// 45: ok
32 num field6; /// 46: ok
33 num field7; /// 47: static type warning
34 num get field8 => null; /// 48: static type warning
35 num field9; /// 49: ok
36 num field10; /// 50: ok
37 set field11(int _) {} /// 51: ok
38 void set field12(int _) {} /// 52: ok
39 num field13; /// 53: static type warning
40 set field14(num _) {} /// 54: static type warning
41 }
42
43 class B extends A {
44 num get getter6 => null; /// 06: continued
45 set setter9(num _) => null; /// 29: continued
46 num field5; /// 45: continued
47 }
48
49 abstract class I {
50 num get getter7 => null; /// 07: continued
51 String get getter8 => null; /// 08: continued
52 int get getter9 => null; /// 09: static type warning
53 int get getter10 => null; /// 10: static type warning
54 int get getter11 => null; /// 11: static type warning
55 set setter10(num _) => null; /// 30: continued
56 set setter11(String _) => null; /// 31: continued
57 set setter12(int _) => null; /// 32: static type warning
58 set setter13(int _) => null; /// 33: static type warning
59 set setter14(int _) => null; /// 34: static type warning
60 }
61
62 abstract class J {
63 String get getter9 => null; /// 09: continued
64 num get getter10 => null; /// 10: continued
65 num get getter11 => null; /// 11: continued
66 set setter12(String _) => null; /// 32: continued
67 set setter13(num _) => null; /// 33: continued
68 set setter14(num _) => null; /// 34: continued
69 }
70
71 abstract class Class extends B implements I, J {
72 get getter1 => null; /// 01: continued
73 num get getter2 => null; /// 02: continued
74 int get getter3 => null; /// 03: continued
75 num get getter4 => null; /// 04: continued
76 double get getter5 => null; /// 05: continued
77 double get getter6 => null; /// 06: continued
78 double get getter7 => null; /// 07: continued
79 double get getter8 => null; /// 08: continued
80 double get getter9 => null; /// 09: continued
81
82 set setter1(_) => null; /// 21: continued
83 set setter2(_) => null; /// 22: continued
84 void set setter3(_) {} /// 23: continued
85 void set setter4(_) {} /// 24: continued
86 set setter5(num _) => null; /// 25: continued
87 set setter6(int _) => null; /// 26: continued
88 set setter7(num _) => null; /// 27: continued
89 set setter8(double _) => null; /// 28: continued
90 set setter9(double _) => null; /// 29: continued
91 set setter10(double _) => null; /// 30: continued
92 set setter11(double _) => null; /// 31: continued
93 set setter12(double _) => null; /// 32: continued
94
95 int field1; /// 41: continued
96 int field2; /// 42: continued
97 num field3; /// 43: continued
98 double field4; /// 44: continued
99 double field5; /// 45: continued
100 int get field6 => null; /// 46: continued
101 String get field7 => null; /// 47: continued
102 String field8; /// 48: continued
103 set field9(int _) {} /// 49: continued
104 void set field10(int _) {} /// 50: continued
105 num field11; /// 51: continued
106 num field12; /// 52: continued
107 set field13(String _) {} /// 53: continued
108 String field14; /// 54: continued
109 }
110
111 class SubClass extends Class {
112 double get getter10 => null; /// 10: continued
113 String get getter11 => null; /// 11: continued
114 set setter13(double _) => null; /// 33: continued
115 set setter14(String _) => null; /// 34: continued
116 }
117
118 main() {
119 new SubClass();
120 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698