@@ -1746,6 +1746,7 @@ void main() {
17461746 group ('Extension' , () {
17471747 Extension arm, leg, ext, fancyList, uphill;
17481748 Extension documentOnceReexportOne, documentOnceReexportTwo;
1749+ Extension staticFieldExtension;
17491750 Library reexportOneLib, reexportTwoLib;
17501751 Class apple,
17511752 anotherExtended,
@@ -1784,6 +1785,8 @@ void main() {
17841785 .firstWhere ((e) => e.name == 'SimpleStringExtension' )
17851786 .instanceMethods
17861787 .firstWhere ((m) => m.name == 'doStuff' );
1788+ staticFieldExtension = exLibrary.extensions
1789+ .firstWhere ((e) => e.name == 'StaticFieldExtension' );
17871790 extensions = exLibrary.publicExtensions.toList ();
17881791 baseTest = fakeLibrary.classes.firstWhere ((e) => e.name == 'BaseTest' );
17891792 bigAnotherExtended =
@@ -1798,6 +1801,11 @@ void main() {
17981801 fakeLibrary.classes.firstWhere ((e) => e.name == 'SuperMegaTron' );
17991802 });
18001803
1804+ test ('static fields inside extensions do not crash' , () {
1805+ expect (staticFieldExtension.staticFields.length, equals (1 ));
1806+ expect (staticFieldExtension.staticFields.first.name, equals ('aStatic' ));
1807+ });
1808+
18011809 test ('basic canonicalization for extensions' , () {
18021810 expect (documentOnceReexportOne.isCanonical, isFalse);
18031811 expect (
@@ -1980,11 +1988,11 @@ void main() {
19801988 });
19811989
19821990 test ('correctly finds all the extensions' , () {
1983- expect (exLibrary.extensions, hasLength (8 ));
1991+ expect (exLibrary.extensions, hasLength (9 ));
19841992 });
19851993
19861994 test ('correctly finds all the public extensions' , () {
1987- expect (extensions, hasLength (6 ));
1995+ expect (extensions, hasLength (7 ));
19881996 });
19891997 });
19901998
0 commit comments