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

Side by Side Diff: pkg/meta/lib/meta.dart

Issue 1706993002: Add the @protected annotation (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 * Constants for use in metadata annotations such as `@protected`. 6 * Constants for use in metadata annotations such as `@protected`.
7 * 7 *
8 * See also `@deprecated` and `@override` in the `dart:core` library. 8 * See also `@deprecated` and `@override` in the `dart:core` library.
9 * 9 *
10 * Annotations provide semantic information 10 * Annotations provide semantic information
11 * that tools can use to provide a better user experience. 11 * that tools can use to provide a better user experience.
12 * For example, an IDE might not autocomplete 12 * For example, an IDE might not autocomplete
13 * the name of a function that's been marked `@deprecated`, 13 * the name of a function that's been marked `@deprecated`,
14 * or it might display the function's name differently. 14 * or it might display the function's name differently.
15 * 15 *
16 * For information on installing and importing this library, see the 16 * For information on installing and importing this library, see the
17 * [meta package on pub.dartlang.org] 17 * [meta package on pub.dartlang.org]
18 * (http://pub.dartlang.org/packages/meta). 18 * (http://pub.dartlang.org/packages/meta).
19 * For examples of using annotations, see 19 * For examples of using annotations, see
20 * [Metadata](https://www.dartlang.org/docs/dart-up-and-running/ch02.html#metada ta) 20 * [Metadata](https://www.dartlang.org/docs/dart-up-and-running/ch02.html#metada ta)
21 * in the language tour. 21 * in the language tour.
22 */ 22 */
23 library meta; 23 library meta;
24
25 /**
26 * Used to annotate an instance method `m` in a class `C`. Indicates that `m`
27 * should only be invoked from instance methods of `C` or classes that extend or
28 * mix in `C`, either directly or indirectly. Additionally indicates that `m`
29 * should only be invoked on `this`, whether explicitly or implicitly.
30 *
31 * Tools, such as the analyzer, can provide feedback if an invocation of a
32 * method marked as being protected is used outside of an instance method
33 * defined on a class that extends or mixes in the class in which the protected
34 * method is defined, or that uses a receiver other than `this`.
35 */
Bob Nystrom 2016/02/17 19:35:07 I understand if analyzer uses /** */ for historica
pquitslund 2016/02/17 19:35:51 Any chance we can jump to the future and adopt `//
Brian Wilkerson 2016/02/17 20:53:19 As much as I prefer "/**" style comments, I was re
36 const _Protected protected = const _Protected();
37
38 class _Protected {
39 const _Protected();
40 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698