Files
swift-mirror/test/attr/ApplicationMain/attr_main_struct.swift
Evan Wilde 2760016689 Don't forward @main into SIL
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()
2021-12-16 16:31:16 -08:00

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 {