Don't require "part file.*.dart" for files in the same directory with the same base name. #60018
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
type-enhancement
A request for a change that isn't a bug
The problem is that having to manually add "part 'file.g.dart';" to get code generators to work is error prone, confusing and adds even more boiler plate to a simple file.
A similar issue: #60016 got shot down because having to scan every file to see if it's linked to another file would be to expensive.
A good compromise would be to keep the part directive for arbitrary files, but also treating any group of files with a common basename in the same directory as a single shared library. (Basically implicit 'part file')
so
basename.dart
basename.g.dart
basename.freezed.dart
basename.customusercode.dart
would automatically be processed the same as if
basename.dart had "part ..." for each of the extra files.
This gives us the advantage of cleaned up code, but also doesn't add any extra processing time to build runner.
The text was updated successfully, but these errors were encountered: