diff --git a/lib/src/entrypoint.dart b/lib/src/entrypoint.dart
index db7c4bc425e5f7c72d1a26dbb70e582d3ea28851..bc084b1c582c9db1524bb107c35a3b8f689fc524 100644
--- a/lib/src/entrypoint.dart
+++ b/lib/src/entrypoint.dart
@@ -694,7 +694,7 @@ class Entrypoint {
   // TODO(nweiz): roll this into [listDir] in io.dart once issue 4775 is fixed.
   /// Recursively lists the contents of [dir], excluding hidden `.DS_Store`
   /// files and `package` files.
-  List<String> _listDirWithoutPackages(dir) {
+  Iterable<String> _listDirWithoutPackages(dir) {
     return listDir(dir).expand/*<String>*/((file) {
       if (p.basename(file) == 'packages') return [];
       if (!dirExists(file)) return [];