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-11621] main never called in synchronous Foundation Operations on Linux #3283

Closed
Frizlab opened this issue Oct 16, 2019 · 2 comments
Closed

Comments

@Frizlab
Copy link
Contributor

Frizlab commented Oct 16, 2019

Previous ID SR-11621
Radar None
Original Reporter @Frizlab
Type Bug
Status Resolved
Resolution Done
Environment

Docker image swift:5.1.1

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: 56f44681053e83413db38876260f25fd

Issue Description:

Given this very simple program:

import Foundation
class MyOp : Operation {
    override func main() { 
        print("hello")
    }
}
 
let op = MyOp()
op.start()

On macOS this works with all versions of Swift.
On Linux, starting with Swift 5.1, the operation is started and finished immediately, without going in the main function.

@Frizlab
Copy link
Contributor Author

Frizlab commented Oct 16, 2019

As a corollary, BlockOperations have the same behaviour: they are finished as soon as they are started when using start() on Swift 5.1 on Linux (they are implemented internally by overriding main).

@spevans
Copy link
Collaborator

spevans commented Feb 7, 2020

This is fixed in swift-5.2-DEVELOPMENT-SNAPSHOT-2020-02-06-a-ubuntu18.04 and master

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants