mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
We've already generated the parts necessary to handle `@main` during SILGen. Keeping the attribute on the struct means that re-ingesting the SIL will fail because it tries to re-create the implicit `$main` function resulting in the following error message: error: invalid redeclaration of synthesized static method '$main()' static func $main()
12 lines
279 B
Swift
12 lines
279 B
Swift
// RUN: %target-swift-frontend -typecheck -parse-as-library -verify %s
|
|
// RUN: %target-swift-frontend -emit-silgen -parse-as-library %s | %FileCheck %s
|
|
|
|
@main
|
|
struct EntryPoint {
|
|
static func main() {
|
|
}
|
|
}
|
|
|
|
// CHECK-NOT: @main struct EntryPoint {
|
|
// CHECK: struct EntryPoint {
|