Added executable entry-point via @main type.

When a type (class, enum, or struct) is annotated @main, it is required
to provide a function with the following signature:

  static func main() -> ()

That function will be called when the executable the type is defined
within is launched.
This commit is contained in:
Nate Chandler
2020-02-14 18:47:06 -08:00
parent 31f715dbda
commit df99de804d
41 changed files with 525 additions and 67 deletions

View File

@@ -55,7 +55,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
/// Don't worry about adhering to the 80-column limit for this line.
const uint16_t SWIFTMODULE_VERSION_MINOR = 554; // serialize accesslevel for OpaqueTypeDecl
const uint16_t SWIFTMODULE_VERSION_MINOR = 555; // add @main attribute
/// A standard hash seed used for all string hashes in a serialized module.
///