Analysis server fails to notice that a file re-exporting main
is runnable
#45192
Labels
area-devexp
Developer Experience related issues (DevTools, IDEs, Analysis Server, completions, refactoring, etc)
contributions-welcome
Contributions welcome to help resolve this (the resolution is expected to be clear from the issue)
devexp-server
Issues related to some aspect of the analysis server
P3
A lower priority bug or feature request
type-enhancement
A request for a change that isn't a bug
Steps to reproduce:
pkg/front_end/test/unit_test_suites.dart
Expected result: the menu item
Run 'unit_test_suites.dart'
should be shownObserved result: no
Run
menu item is shownNote that all this file does is export
unit_test_suites_impl.dart
, which declares amain
function. Therefore it should have amain
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 leavingmain
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.The text was updated successfully, but these errors were encountered: