mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
14 lines
802 B
Swift
14 lines
802 B
Swift
// RUN: %target-swift-frontend -typecheck -parse-as-library -verify %s
|
|
|
|
@main // expected-error{{'Foo' is annotated with '@main' and must provide a main static function}}
|
|
// expected-note@-1{{add 'static func main()'}} {{8:13-13=\n static func main() {\n <#code#>\n }\n}}
|
|
// expected-note@-2{{add 'static func main() throws'}} {{8:13-13=\n static func main() throws {\n <#code#>\n }\n}}
|
|
// expected-note@-3{{add 'static func main() async'}} {{8:13-13=\n static func main() async {\n <#code#>\n }\n}}
|
|
// expected-note@-4{{add 'static func main() async throws'}} {{8:13-13=\n static func main() async throws {\n <#code#>\n }\n}}
|
|
struct Foo {
|
|
@dynamicCallable
|
|
struct main {
|
|
func dynamicallyCall(withArguments args: [Any]) -> () { return }
|
|
}
|
|
}
|