OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 | 4 |
5 /** | 5 /** |
6 * This library contains the definitions of annotations that provide additional | 6 * Constants for use in metadata annotations such as |
7 * semantic information about the program being annotated. These annotations are | 7 * `@deprecated`, `@override`, and `@proxy`. |
8 * intended to be used by tools to provide a better user experience. | 8 * |
| 9 * Annotations provide semantic information |
| 10 * that tools can use to provide a better user experience. |
| 11 * For example, an IDE might not autocomplete |
| 12 * the name of a function that's been marked `@deprecated`, |
| 13 * or it might display the function's name differently. |
9 * | 14 * |
10 * ## Installing ## | 15 * For information on installing and importing this library, see the |
11 * | 16 * [meta package on pub.dartlang.org] |
12 * Use [pub][] to install this package. Add the following to your `pubspec.yaml` | 17 * (http://pub.dartlang.org/packages/meta). |
13 * file. | 18 * For examples of using annotations, see |
14 * | 19 * [Metadata](https://www.dartlang.org/docs/dart-up-and-running/contents/ch02.ht
ml#ch02-metadata) |
15 * dependencies: | 20 * in the language tour. |
16 * meta: any | |
17 * | |
18 * Then run `pub install`. | |
19 * | |
20 * For more information, see the | |
21 * [meta package on pub.dartlang.org](http://pub.dartlang.org/packages/meta). | |
22 * | |
23 * [pub]: http://pub.dartlang.org | |
24 */ | 21 */ |
25 library meta; | 22 library meta; |
26 | 23 |
27 /** | 24 /** |
28 * An annotation used to mark a class, field, getter, setter, method, top-level | 25 * An annotation used to mark a class, field, getter, setter, method, top-level |
29 * variable, or top-level function as one that should no longer be used. Tools | 26 * variable, or top-level function as one that should no longer be used. Tools |
30 * can use this annotation to provide a warning on references to the marked | 27 * can use this annotation to provide a warning on references to the marked |
31 * element. | 28 * element. |
32 */ | 29 */ |
33 const deprecated = const _Deprecated(); | 30 const deprecated = const _Deprecated(); |
(...skipping 20 matching lines...) Expand all Loading... |
54 * member. Tools should provide a hint if this annotation is applied to a class | 51 * member. Tools should provide a hint if this annotation is applied to a class |
55 * that does not implement or inherit an implementation of the method | 52 * that does not implement or inherit an implementation of the method |
56 * [:noSuchMethod:] (other than the implementation in [Object]). Note that | 53 * [:noSuchMethod:] (other than the implementation in [Object]). Note that |
57 * classes are not affected by the use of this annotation on a supertype. | 54 * classes are not affected by the use of this annotation on a supertype. |
58 */ | 55 */ |
59 const proxy = const _Proxy(); | 56 const proxy = const _Proxy(); |
60 | 57 |
61 class _Proxy { | 58 class _Proxy { |
62 const _Proxy(); | 59 const _Proxy(); |
63 } | 60 } |
OLD | NEW |