@@ -194,6 +194,7 @@ void main() {
194194 @MapLike()
195195 @VisibleClass.secret()
196196 @fieldOnly
197+ @ClassWithStaticField.staticField
197198 class Example {}
198199
199200 class Int64Like {
@@ -230,8 +231,13 @@ void main() {
230231 class _FieldOnlyVisible {
231232 const _FieldOnlyVisible();
232233 }
233-
234+
234235 const fieldOnly = const _FieldOnlyVisible();
236+
237+ class ClassWithStaticField {
238+ static const staticField = const ClassWithStaticField._();
239+ const ClassWithStaticField._();
240+ }
235241 ''' , (resolver) => resolver.findLibraryByName ('test_lib' ));
236242 constants = library
237243 .getType ('Example' )
@@ -242,8 +248,8 @@ void main() {
242248
243249 test ('should decode Int64Like.ZERO' , () {
244250 final int64Like0 = constants[0 ].revive ();
245- expect (int64Like0.source.toString (), endsWith ( '#Int64Like' ) );
246- expect (int64Like0.accessor, 'ZERO' );
251+ expect (int64Like0.source.fragment, isEmpty );
252+ expect (int64Like0.accessor, 'Int64Like. ZERO' );
247253 });
248254
249255 test ('should decode Duration' , () {
@@ -260,8 +266,8 @@ void main() {
260266
261267 test ('should decode enums' , () {
262268 final enumField1 = constants[2 ].revive ();
263- expect (enumField1.source.toString (), endsWith ( '#Enum' ) );
264- expect (enumField1.accessor, 'field1' );
269+ expect (enumField1.source.fragment, isEmpty );
270+ expect (enumField1.accessor, 'Enum. field1' );
265271 });
266272
267273 test ('should decode forwarding factories' , () {
@@ -281,5 +287,11 @@ void main() {
281287 expect (fieldOnly.source.fragment, isEmpty);
282288 expect (fieldOnly.accessor, 'fieldOnly' );
283289 });
290+
291+ test ('should decode static fields' , () {
292+ final fieldOnly = constants[6 ].revive ();
293+ expect (fieldOnly.source.fragment, isEmpty);
294+ expect (fieldOnly.accessor, 'ClassWithStaticField.staticField' );
295+ });
284296 });
285297}
0 commit comments