|
2 | 2 | // for details. All rights reserved. Use of this source code is governed by a
|
3 | 3 | // BSD-style license that can be found in the LICENSE file.
|
4 | 4 |
|
| 5 | +// SharedOptions=--enable-experiment=records |
| 6 | + |
5 | 7 | main() {
|
6 | 8 | (int, int) record1 = (1, 2);
|
7 |
| -//^ |
8 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
9 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
10 |
| -// ^ |
11 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
12 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
13 | 9 | print(record1);
|
14 | 10 | (int x, int y) record1Named = (1, 2);
|
15 |
| -//^ |
16 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
17 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
18 |
| -// ^ |
19 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
20 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
21 | 11 | print(record1Named);
|
22 | 12 |
|
23 | 13 | (int, int, ) record2 = (1, 2);
|
24 |
| -//^ |
25 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
26 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
27 |
| -// ^ |
28 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
29 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
30 | 14 | print(record2);
|
31 | 15 |
|
32 | 16 | (int x, int y, ) record2Named = (1, 2);
|
33 |
| -//^ |
34 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
35 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
36 |
| -// ^ |
37 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
38 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
39 | 17 | print(record2Named);
|
40 | 18 |
|
41 | 19 | (int, int, {int a, int b}) record3 = (1, 2, a: 3, b: 4);
|
42 |
| -//^ |
43 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
44 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
45 |
| -// ^ |
46 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
47 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
48 | 20 | print(record3);
|
49 | 21 |
|
50 | 22 | (int x, int y, {int a, int b}) record3Named = (1, 2, a: 3, b: 4);
|
51 |
| -//^ |
52 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
53 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
54 |
| -// ^ |
55 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
56 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
57 | 23 | print(record3Named);
|
58 | 24 |
|
59 | 25 | (int, int, {int a, int b, }) record4 = (1, 2, a: 3, b: 4);
|
60 |
| -//^ |
61 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
62 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
63 |
| -// ^ |
64 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
65 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
66 | 26 | print(record4);
|
67 | 27 |
|
68 | 28 | (int x, int y, {int a, int b, }) record4Named = (1, 2, a: 3, b: 4);
|
69 |
| -//^ |
70 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
71 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
72 |
| -// ^ |
73 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
74 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
75 | 29 | print(record4Named);
|
76 | 30 |
|
77 | 31 | print(foo((42, b: true), 42));
|
78 |
| - // ^ |
79 |
| - // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
80 |
| - // [cfe] This requires the experimental 'records' language feature to be enabled. |
81 | 32 |
|
82 | 33 | Bar b = new Bar();
|
83 | 34 | print(b.foo(42));
|
84 | 35 | (int, int) Function ((int, int) a) z1 = ((int, int) a) { return (42, 42); };
|
85 |
| -//^ |
86 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
87 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
88 |
| -// ^ |
89 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
90 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
91 |
| -// ^ |
92 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
93 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
94 |
| -// ^ |
95 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
96 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
97 | 36 |
|
98 | 37 | final (int x, int y) finalRecordType = (42, 42);
|
99 |
| - // ^ |
100 |
| - // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
101 |
| - // [cfe] This requires the experimental 'records' language feature to be enabled. |
102 |
| - // ^ |
103 |
| - // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
104 |
| - // [cfe] This requires the experimental 'records' language feature to be enabled. |
105 | 38 |
|
106 | 39 | List<(int, int)> listOfRecords = [];
|
107 |
| - // ^ |
108 |
| - // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
109 |
| - // [cfe] This requires the experimental 'records' language feature to be enabled. |
110 | 40 |
|
111 | 41 | var listOfRecords2 = <(int, int)>[];
|
112 |
| - // ^ |
113 |
| - // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
114 |
| - // [cfe] This requires the experimental 'records' language feature to be enabled. |
115 | 42 | }
|
116 | 43 |
|
117 | 44 | (int, T) f1<T>(T t) {
|
118 |
| -// [error column 1, length 1] |
119 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
120 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
121 | 45 | return (42, t);
|
122 |
| - // ^ |
123 |
| - // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
124 |
| - // [cfe] This requires the experimental 'records' language feature to be enabled. |
125 | 46 | }
|
126 | 47 |
|
127 | 48 | (int, T) f2<T>(T t) => (42, t);
|
128 |
| -// [error column 1, length 1] |
129 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
130 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
131 |
| -// ^ |
132 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
133 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
134 | 49 |
|
135 | 50 | (int a, String b) get topLevelGetterType => throw '';
|
136 |
| -// [error column 1, length 1] |
137 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
138 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
139 | 51 |
|
140 | 52 | (int, int) foo((int, {bool b}) inputRecord, int x) {
|
141 |
| -// [error column 1, length 1] |
142 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
143 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
144 |
| -// ^ |
145 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
146 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
147 | 53 | if (inputRecord.b) return (42, 42);
|
148 |
| - // ^ |
149 |
| - // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
150 |
| - // [cfe] This requires the experimental 'records' language feature to be enabled. |
151 | 54 | return (1, 1, );
|
152 |
| - // ^ |
153 |
| - // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
154 |
| - // [cfe] This requires the experimental 'records' language feature to be enabled. |
155 | 55 | }
|
156 | 56 |
|
157 | 57 | class Bar {
|
158 | 58 | (int, int) foo(int x) => (42, 42);
|
159 |
| -//^ |
160 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
161 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
162 |
| -// ^ |
163 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
164 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
165 | 59 |
|
166 | 60 | static (int x, int y) staticRecordType = (42, 42);
|
167 |
| - // ^ |
168 |
| - // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
169 |
| - // [cfe] This requires the experimental 'records' language feature to be enabled. |
170 |
| - // ^ |
171 |
| - // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
172 |
| - // [cfe] This requires the experimental 'records' language feature to be enabled. |
173 | 61 |
|
174 | 62 | (int a, String b) get instanceGetterType => throw '';
|
175 |
| -//^ |
176 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
177 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
178 | 63 |
|
179 | 64 | static (int a, String b) get staticGetterType => throw '';
|
180 |
| -// ^ |
181 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
182 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
183 | 65 |
|
184 | 66 | (int, T) f1<T>(T t) {
|
185 |
| -//^ |
186 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
187 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
188 | 67 | return (42, t);
|
189 |
| - // ^ |
190 |
| - // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
191 |
| - // [cfe] This requires the experimental 'records' language feature to be enabled. |
192 | 68 | }
|
193 | 69 |
|
194 | 70 | (int, T) f2<T>(T t) => (42, t);
|
195 |
| -//^ |
196 |
| -// [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
197 |
| -// [cfe] This requires the experimental 'records' language feature to be enabled. |
198 |
| - // ^ |
199 |
| - // [analyzer] SYNTACTIC_ERROR.EXPERIMENT_NOT_ENABLED |
200 |
| - // [cfe] This requires the experimental 'records' language feature to be enabled. |
201 | 71 | }
|
202 | 72 |
|
0 commit comments