Description
See dart-lang/language#3642 for the background discussion.
This issue tracks the implementation of a startup time error which is emitted by the CFE when an execution of a Dart program is requested and the given entry point (the file that "is" the program) is an library augmentation. For example:
// --- Library 'main.dart'.
import augment 'augment.dart';
...
void main() {}
// --- Library augmentation 'augment.dart'.
augment library 'main.dart';
...
With these Dart source files, it is a startup time error to execute the program using a command like dart augment.dart
because augment.dart
is a library augmentation. However, dart main.dart
is fine.
Note that the declaration of the top-level function main
could occur in the library or in the library augmentation, and that would not make a difference (the library main.dart
will export main
in either case, and using augment.dart
as an entry point is an error in either case).