Files
swift-mirror/test/attr/ApplicationMain/attr_main_struct_available_future.swift
Nate Chandler df99de804d 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.
2020-04-17 09:53:46 -07:00

14 lines
277 B
Swift

// RUN: %target-swift-frontend -typecheck -parse-as-library -verify %s
// REQUIRES: OS=macosx
@main // expected-error {{'main()' is only available in macOS 10.99 or newer}}
@available(OSX 10.0, *)
struct EntryPoint {
@available(OSX 10.99, *)
static func main() {
}
}