File tree Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -6516,7 +6516,9 @@ class PackageBuilder {
65166516 }
65176517 }
65186518 var sourceKind = await driver.getSourceKind (filePath);
6519- if (sourceKind == SourceKind .LIBRARY ) {
6519+ // Allow dart source files with inappropriate suffixes (#1897). Those
6520+ // do not show up as SourceKind.LIBRARY.
6521+ if (sourceKind != SourceKind .PART ) {
65206522 // Loading libraryElements from part files works, but is painfully slow
65216523 // and creates many duplicates.
65226524 return await driver.currentSession.getResolvedLibrary (source.fullName);
Original file line number Diff line number Diff line change @@ -675,6 +675,10 @@ void main() {
675675 expect (anonLib.isDeprecated, isFalse);
676676 });
677677
678+ test ('can be reexported even if the file suffix is not .dart' , () {
679+ expect (fakeLibrary.allClasses.map ((c) => c.name), contains ('MyClassFromADartFile' ));
680+ });
681+
678682 test ('that is deprecated has a deprecated css class in linkedName' , () {
679683 expect (isDeprecated.linkedName, contains ('class="deprecated"' ));
680684 });
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ import 'example.dart';
5858import 'mylibpub.dart' as renamedLib;
5959import 'mylibpub.dart' as renamedLib2;
6060import 'two_exports.dart' show BaseClass;
61+ export 'src/notadotdartfile' ;
6162
6263// ignore: uri_does_not_exist
6364export 'package:test_package_imported/categoryExporting.dart'
Original file line number Diff line number Diff line change 1+ /// Test importing with an invalid dart file extension. (#1897)
2+ library test_package.notadotdartfile;
3+
4+ class MyClassFromADartFile {}
You can’t perform that action at this time.
0 commit comments