mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
11 lines
152 B
Swift
11 lines
152 B
Swift
// RUN: %target-swift-frontend -typecheck -parse-as-library -verify %s
|
|
|
|
class MainBase {
|
|
static func main() {
|
|
}
|
|
}
|
|
|
|
@main
|
|
class Main : MainBase { }
|
|
|