Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 part of dart.core; | 5 part of dart.core; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * The annotation "@Deprecated('expires when')" marks a feature as deprecated. | 8 * The annotation `@Deprecated('expires when')` marks a feature as deprecated. |
| 9 * | 9 * |
| 10 * The annotation "@deprecated" is a shorthand for deprecating until | 10 * The annotation `@deprecated` is a shorthand for deprecating until |
| 11 * to an unspecified "next release". | 11 * to an unspecified "next release". |
| 12 * | 12 * |
| 13 * The intent of the "@Deprecated" annotation is to inform users of a feature | 13 * The intent of the `@Deprecated` annotation is to inform users of a feature |
| 14 * that they should change their code, even if it is currently still working | 14 * that they should change their code, even if it is currently still working |
| 15 * correctly. | 15 * correctly. |
| 16 * | 16 * |
| 17 * A deprecated feature is scheduled to be removed at a later time, possibly | 17 * A deprecated feature is scheduled to be removed at a later time, possibly |
| 18 * specified as the "expires" field of the annotation. | 18 * specified as the "expires" field of the annotation. |
| 19 * This means that a deprecated feature should not be used, or code using it | 19 * This means that a deprecated feature should not be used, or code using it |
| 20 * will break at some point in the future. If there is code using the feature, | 20 * will break at some point in the future. If there is code using the feature, |
| 21 * that code should be rewritten to not use the deprecated feature. | 21 * that code should be rewritten to not use the deprecated feature. |
| 22 * | 22 * |
| 23 * A deprecated feature should document how the same effect can be achieved, | 23 * A deprecated feature should document how the same effect can be achieved, |
| 24 * so the programmer knows how to rewrite the code. | 24 * so the programmer knows how to rewrite the code. |
| 25 * | 25 * |
| 26 * The "@Deprecated" annotation applies to libraries, top-level declarations | 26 * The `@Deprecated` annotation applies to libraries, top-level declarations |
| 27 * (variables, getters, setters, functions, classes and typedefs), | 27 * (variables, getters, setters, functions, classes and typedefs), |
| 28 * class-level declarations (variables, getters, setters, methods, operators or | 28 * class-level declarations (variables, getters, setters, methods, operators or |
| 29 * constructors, whether static or not), named optional arguments and | 29 * constructors, whether static or not), named optional arguments and |
| 30 * trailing optional positional parameters. | 30 * trailing optional positional parameters. |
| 31 * | 31 * |
| 32 * Deprecation is transitive: | 32 * Deprecation is transitive: |
| 33 * | 33 * |
| 34 * - If a library is deprecated, so is every member of it. | 34 * - If a library is deprecated, so is every member of it. |
| 35 * - If a class is deprecated, so is every member of it. | 35 * - If a class is deprecated, so is every member of it. |
| 36 * - If a variable is deprecated, so are its implicit getter and setter. | 36 * - If a variable is deprecated, so are its implicit getter and setter. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 class _Override { | 75 class _Override { |
| 76 const _Override(); | 76 const _Override(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * Marks a feature as [Deprecated] until the next release. | 80 * Marks a feature as [Deprecated] until the next release. |
| 81 */ | 81 */ |
| 82 const deprecated = const Deprecated("next release"); | 82 const deprecated = const Deprecated("next release"); |
| 83 | 83 |
| 84 /* | 84 /* |
| 85 * The annotation "@override" marks an instance member as overriding a | 85 * The annotation `@override` marks an instance member as overriding a |
| 86 * superclass member with the same name. | 86 * superclass member with the same name. |
| 87 * | 87 * |
| 88 * The annotation applies to instance methods, getters and setters, and to | 88 * The annotation applies to instance methods, getters and setters, and to |
| 89 * instance fields, where it means that the implicit getter and setter of the | 89 * instance fields, where it means that the implicit getter and setter of the |
| 90 * field is marked as overriding, but the field itself is not. | 90 * field is marked as overriding, but the field itself is not. |
| 91 * | 91 * |
| 92 * A tool may report if no declaration of an annotated member is inherited by | 92 * A tool may report if no declaration of an annotated member is inherited by |
| 93 * the class from either a superclass or an interface. | 93 * the class from either a superclass or an interface. |
| 94 * | 94 * |
| 95 * The intent of the "override" notation is to catch situations where a | 95 * The intent of the `@override` notation is to catch situations where a |
| 96 * superclass renames a member, and an independent subclass which used to | 96 * superclass renames a member, and an independent subclass which used to |
| 97 * override the member, could silently continue working using the | 97 * override the member, could silently continue working using the |
| 98 * superclass implementation. | 98 * superclass implementation. |
| 99 * | 99 * |
| 100 * The "@override" annotation is intentionally not used in the core libraries. | 100 * The `@override` annotation is intentionally not used in the core libraries. |
| 101 * It is intended for the editor, or similar tools, to support user written | 101 * It is intended for the editor, or similar tools, to support user written |
| 102 * code. | 102 * code. |
| 103 */ | 103 */ |
| 104 const override = const _Override(); | 104 const override = const _Override(); |
| 105 | |
| 106 class _Proxy { | |
| 107 const _Proxy(); | |
| 108 } | |
| 109 | |
| 110 /** | |
| 111 * The annotation `@proxy` marks a class as implementing members through | |
| 112 * `noSuchMethod`. | |
| 113 * | |
| 114 * The annotation applies to concrete classes. It is not inherited by | |
| 115 * subclasses. | |
| 116 * | |
| 117 * The marked class is considerer to implement any method, getter or setter | |
| 118 * declared by its interface, even if there is no implementation in the | |
| 119 * class. It will not generate the warning that is otherwise speified for an | |
|
karlklose
2013/10/29 10:40:06
'speified' -> 'specified'.
| |
| 120 * unimplemented method in a non-abstract class. | |
| 121 * | |
| 122 * The intent of the `@proxy` notation is to avoid irrelevant warnings when | |
| 123 * a class implements its interface through `noSuchMethod`. | |
| 124 */ | |
| 125 const proxy = const _Proxy(); | |
| OLD | NEW |