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-2098] Swift 3 regression, compiler crash #44706

Closed
swift-ci opened this issue Jul 16, 2016 · 1 comment
Closed

[SR-2098] Swift 3 regression, compiler crash #44706

swift-ci opened this issue Jul 16, 2016 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software regression swift 3.0

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-2098
Radar rdar://problem/27389992
Original Reporter slizeray (JIRA User)
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

Version 8.0 beta 2 (8S162m)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 3.0Regression, CompilerCrash
Assignee None
Priority Medium

md5: 441ffc9953af9a284e6d53decc8e26e8

Issue Description:

Implement a public method in an extension of a public class in a framework

Override this method from within an other module (for instance an app), the compiler crashes


public class TestTableViewController: UITableViewController {

    override public func viewDidLoad() {
        super.viewDidLoad()

        // Uncomment the following line to preserve selection between presentations
        // self.clearsSelectionOnViewWillAppear = false

        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem()
    }

    override public func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    // MARK: - Table view data source

    override public func numberOfSections(in tableView: UITableView) -> Int {
        // #warning Incomplete implementation, return the number of sections
        return 0
    }

    override public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of rows
        return 0
    }


}

extension TestTableViewController {

    // Move this method into the main class declaration and the segment faul disappears
    override public func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
        super.viewWillTransition(to: size, with: coordinator)
        coordinator.animate(alongsideTransition: { (context) -> Void in

        }) { (context) -> Void in
        }
    }

}



class ViewController: TestTableViewController {

    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
        super.viewWillTransition(to: size, with: coordinator)
        coordinator.animate(alongsideTransition: { (context) -> Void in

        }) { (context) -> Void in
        }
    }

}

1. While emitting IR SIL function @TFC15TestOverrideApp14ViewController18viewWillTransitionfT2toVSC6CGSize4withPSo37UIViewControllerTransitionCoordinatorT for 'viewWillTransition' at /Users/slizeray/tmp/crash/Archive/TestOverride/TestOverrideApp/TestOverrideApp/ViewController.swift:25:11

@swift-ci
Copy link
Collaborator Author

Comment by Stéphane Lizeray (JIRA)

it is fixed now...

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 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 crash Bug: A crash, i.e., an abnormal termination of software regression swift 3.0
Projects
None yet
Development

No branches or pull requests

2 participants