Skip to content

A library augmentation can not be an entry point #55403

Open
@eernstg

Description

@eernstg

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work oncfe-feature-macrosImplement macros features in the CFEimplementationTrack the implementation of a specific feature (use on area-meta issue, not issues for each tool)legacy-area-front-endLegacy: Use area-dart-model instead.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions