-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Steps to reproduce:
- Check out Dart SDK as of 8be5353
- In IntelliJ, open the file
pkg/front_end/test/unit_test_suites.dart - Right click within the file view
Expected result: the menu item Run 'unit_test_suites.dart' should be shown
Observed result: no Run menu item is shown
Note that all this file does is export unit_test_suites_impl.dart, which declares a main function. Therefore it should have a main function in its export namespace, so it should be runnable. Prior to null safety, this would have been a really obscure use case. However, with null safety, there's actually a really good reason to do this: it allows the entry point to be marked with // @dart = 2.9 (so that the program will be run in weak null safety mode), while leaving main opted in (so that it gets the static compilation benefits of null safety mode). This is necessary because due to out-of-order migration, some of the code in the program's transitive import graph has not yet been migrated to null safety. Now that null safety is out, I suspect this is going to be a much more common use case.