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

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

Issue 2352433002: support `@virtual` fields, fix #27384 (Closed)
Patch Set: Created 4 years, 3 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 | « pkg/meta/CHANGELOG.md ('k') | pkg/meta/pubspec.yaml » ('j') | 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 /// Constants for use in metadata annotations. 5 /// Constants for use in metadata annotations.
6 /// 6 ///
7 /// See also `@deprecated` and `@override` in the `dart:core` library. 7 /// See also `@deprecated` and `@override` in the `dart:core` library.
8 /// 8 ///
9 /// Annotations provide semantic information that tools can use to provide a 9 /// Annotations provide semantic information that tools can use to provide a
10 /// better user experience. For example, an IDE might not autocomplete the name 10 /// better user experience. For example, an IDE might not autocomplete the name
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 /// @Required('Buttons must do something when pressed') 121 /// @Required('Buttons must do something when pressed')
122 /// Function onPressed, 122 /// Function onPressed,
123 /// ... 123 /// ...
124 /// }) ... 124 /// }) ...
125 final String reason; 125 final String reason;
126 126
127 /// Initialize a newly created instance to have the given [reason]. 127 /// Initialize a newly created instance to have the given [reason].
128 const Required([this.reason]); 128 const Required([this.reason]);
129 } 129 }
130 130
131
132 /// Used to annotate a parameter of an instance method that overrides another 131 /// Used to annotate a parameter of an instance method that overrides another
133 /// method. 132 /// method.
134 /// 133 ///
135 /// Indicates that this parameter may have a tighter type than the parameter on 134 /// Indicates that this parameter may have a tighter type than the parameter on
136 /// its superclass. The actual argument will be checked at runtime to ensure it 135 /// its superclass. The actual argument will be checked at runtime to ensure it
137 /// is a subtype of the overridden parameter type. 136 /// is a subtype of the overridden parameter type.
138 const _Checked checked = const _Checked(); 137 const _Checked checked = const _Checked();
139 138
139 /// Used to annotate a field is allowed to be overridden in Strong Mode.
140 const _Virtual virtual = const _Virtual();
141
140 class _Checked { 142 class _Checked {
141 const _Checked(); 143 const _Checked();
142 } 144 }
143 145
144 class _Factory { 146 class _Factory {
145 const _Factory(); 147 const _Factory();
146 } 148 }
147 149
148 class _Literal { 150 class _Literal {
149 const _Literal(); 151 const _Literal();
150 } 152 }
151 153
152 class _MustCallSuper { 154 class _MustCallSuper {
153 const _MustCallSuper(); 155 const _MustCallSuper();
154 } 156 }
155 157
156 class _OptionalTypeArgs { 158 class _OptionalTypeArgs {
157 const _OptionalTypeArgs(); 159 const _OptionalTypeArgs();
158 } 160 }
159 161
160 class _Protected { 162 class _Protected {
161 const _Protected(); 163 const _Protected();
162 } 164 }
163 165
166 class _Virtual {
167 const _Virtual();
168 }
169
164 class _VisibleForTesting { 170 class _VisibleForTesting {
165 const _VisibleForTesting(); 171 const _VisibleForTesting();
166 } 172 }
OLDNEW
« no previous file with comments | « pkg/meta/CHANGELOG.md ('k') | pkg/meta/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698