|
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 |
| -/// @assertion Assuming that v is the language version in which records are |
6 |
| -/// released, the following errors apply. |
| 5 | +/// @assertion The records feature is language versioned, as usual with new Dart |
| 6 | +/// features. This means that it will be an error to use the syntax for records |
| 7 | +/// in libraries which do not have a language version greater than or equal to |
| 8 | +/// the language version in which records are released. |
7 | 9 | ///
|
8 |
| -/// It is an error for the identifier [Record], denoting the [Record] class from |
9 |
| -/// dart:core, where that import scope name is only imported from platform |
10 |
| -/// libraries, to appear in a library whose language version is less than v. |
11 |
| -/// |
12 |
| -/// @description Check that it is a compile-time error if class [Record] from |
13 |
| -/// dart:core is used in a library whose language version is less than v. |
| 10 | +/// @description Check that it is not an error if class [Record] from dart:core |
| 11 | +/// is used in a library whose language version is less than language version in |
| 12 | +/// which records are released. |
14 | 13 |
|
15 | 14 |
|
16 | 15 | // SharedOptions=--enable-experiment=records
|
17 | 16 |
|
18 | 17 | // @dart = 2.18
|
19 | 18 |
|
| 19 | +import "interaction_with_legacy_A01_lib.dart"; |
| 20 | + |
20 | 21 | typedef T1 = Record;
|
21 |
| -// ^^^^^^ |
22 |
| -// [analyzer] unspecified |
23 |
| -// [cfe] unspecified |
24 | 22 |
|
25 | 23 | T? foo<T>(T? t) => t;
|
26 | 24 |
|
27 | 25 | main() {
|
28 | 26 | Record? r = null;
|
29 |
| -//^^^^^^ |
30 |
| -// [analyzer] unspecified |
31 |
| -// [cfe] unspecified |
32 | 27 | foo<Record>(null);
|
33 |
| -// ^^^^^^ |
34 |
| -// [analyzer] unspecified |
35 |
| -// [cfe] unspecified |
36 | 28 | }
|
0 commit comments