| 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 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 String toString() => "Deprecated feature. Will be removed $expires"; | 72 String toString() => "Deprecated feature. Will be removed $expires"; |
| 73 } | 73 } |
| 74 | 74 |
| 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 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 * The intent of the `@override` notation is to catch situations where a | 92 * The intent of the `@override` notation is to catch situations where a |
| 93 * superclass renames a member, and an independent subclass which used to | 93 * superclass renames a member, and an independent subclass which used to |
| 94 * override the member, could silently continue working using the | 94 * override the member, could silently continue working using the |
| 95 * superclass implementation. | 95 * superclass implementation. |
| 96 * | 96 * |
| 97 * The editor, or a similar tool aimed at the programmer, may report if no | 97 * The editor, or a similar tool aimed at the programmer, may report if no |
| 98 * declaration of an annotated member is inherited by the class from either a | 98 * declaration of an annotated member is inherited by the class from either a |
| 99 * superclass or an interface. | 99 * superclass or an interface. |
| 100 * | 100 * |
| 101 * Use the `@override` annotation judiciously and only for methods where | 101 * Use the `@override` annotation judiciously and only for methods where |
| 102 * the superclass is not under the programmer's control, the superclass is in a | 102 * the superclass is not under the programmer's control, the superclass is in a |
| 103 * different library or package, and it is not considered stable. | 103 * different library or package, and it is not considered stable. |
| 104 * In any case, the use of `@override` is optional. | 104 * In any case, the use of `@override` is optional. |
| 105 * | 105 * |
| 106 * For example, the annotation is intentionally not used in the Dart platform | 106 * For example, the annotation is intentionally not used in the Dart platform |
| 107 * libraries, since they only depend on themselves. | 107 * libraries, since they only depend on themselves. |
| 108 */ | 108 */ |
| 109 const override = const _Override(); | 109 const Object override = const _Override(); |
| 110 | 110 |
| 111 class _Proxy { | 111 class _Proxy { |
| 112 const _Proxy(); | 112 const _Proxy(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 /** | 115 /** |
| 116 * The annotation `@proxy` marks a class as implementing members through | 116 * The annotation `@proxy` marks a class as implementing members through |
| 117 * `noSuchMethod`. | 117 * `noSuchMethod`. |
| 118 * | 118 * |
| 119 * The annotation applies to concrete classes. It is not inherited by | 119 * The annotation applies to concrete classes. It is not inherited by |
| 120 * subclasses. | 120 * subclasses. |
| 121 * | 121 * |
| 122 * The marked class is considerer to implement any method, getter or setter | 122 * The marked class is considerer to implement any method, getter or setter |
| 123 * declared by its interface, even if there is no implementation in the | 123 * declared by its interface, even if there is no implementation in the |
| 124 * class. It will not generate the warning that is otherwise specified for an | 124 * class. It will not generate the warning that is otherwise specified for an |
| 125 * unimplemented method in a non-abstract class. | 125 * unimplemented method in a non-abstract class. |
| 126 * | 126 * |
| 127 * Tools that understand `@proxy` should tell the user if a class using `@proxy` | 127 * Tools that understand `@proxy` should tell the user if a class using `@proxy` |
| 128 * does not override the `noSuchMethod` declared on [Object]. | 128 * does not override the `noSuchMethod` declared on [Object]. |
| 129 * | 129 * |
| 130 * The intent of the `@proxy` notation is to avoid irrelevant warnings when | 130 * The intent of the `@proxy` notation is to avoid irrelevant warnings when |
| 131 * a class implements its interface through `noSuchMethod`. | 131 * a class implements its interface through `noSuchMethod`. |
| 132 */ | 132 */ |
| 133 const proxy = const _Proxy(); | 133 const Object proxy = const _Proxy(); |
| OLD | NEW |