Skip to content

co19/Language/Libraries_and_Scripts/Scripts/top_level_main_t05 #947

@scheglov

Description

@scheglov

The spec says It is a compile-time error unless D is a function declaration. Nothing about a getter.

/**
 * @assertion It is a run time error if S does not declare or export either:
 * • A top-level function named main, or
 * • A top-level getter named main that returns a function.
 * @description Checks that it is not a runtime error if S declares a top-level
 * getter named main, returning function.
 * @author [email protected]
 * @issue 42492
 */
import "../../../Utils/expect.dart";

var x = 1;
get main => () { Expect.equals(1, x); };

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions