mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -2974,9 +2974,9 @@ bool SerializedASTFile::getAllGenericSignatures(
|
||||
return true;
|
||||
}
|
||||
|
||||
ClassDecl *SerializedASTFile::getMainClass() const {
|
||||
Decl *SerializedASTFile::getMainDecl() const {
|
||||
assert(hasEntryPoint());
|
||||
return cast_or_null<ClassDecl>(File.getDecl(File.Bits.EntryPointDeclID));
|
||||
return File.getDecl(File.Bits.EntryPointDeclID);
|
||||
}
|
||||
|
||||
const version::Version &SerializedASTFile::getLanguageVersionBuiltWith() const {
|
||||
|
||||
Reference in New Issue
Block a user