mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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:
@@ -4986,7 +4986,7 @@ void Serializer::writeAST(ModuleOrSourceFile DC) {
|
||||
}
|
||||
for (auto nextFile : files) {
|
||||
if (nextFile->hasEntryPoint())
|
||||
entryPointClassID = addDeclRef(nextFile->getMainClass());
|
||||
entryPointClassID = addDeclRef(nextFile->getMainDecl());
|
||||
|
||||
// FIXME: Switch to a visitor interface?
|
||||
SmallVector<Decl *, 32> fileDecls;
|
||||
|
||||
Reference in New Issue
Block a user