Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-14957] SIL should drop '@main' on printing or ignore it during parsing #57299

Closed
typesanitizer opened this issue Jul 22, 2021 · 3 comments
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@typesanitizer
Copy link

Previous ID SR-14957
Radar rdar://problem/80971052
Original Reporter @typesanitizer
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @etcwilde
Priority Medium

md5: 5197152066918f2afdf50f16506bd4ed

Issue Description:

If you try to generate SIL for Swift code using @main, it creates something like:

@main struct M {
  static func main() async
  static func $main() // error: invalid redeclaration of synthesized static method '$main()'
  init()
}

Triggering a diagnostic is unfortunate, it seems like having the @main is redundant at this stage since the $main is already present. So either we should not emit the @main in the SIL or we should not emit this error when reading back SIL.

@typesanitizer
Copy link
Author

@swift-ci create

@etcwilde
Copy link
Member

Fix posted: #40601

@etcwilde
Copy link
Member

PR merged. This should no longer be an issue on tip-of-main.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

2 participants