Optimizer bug (related to defer)

found a bug in optimizer (doesn't happen with -Onone)
FB9030673

import Foundation

class C {
    init() {
        defer {
            if !success {
                fatalError("BUG!")
            }
        }
        var success = false
        success = true
        print("comment me and see what happens. swift optimizer bug (-O and -Osize, doesn't happen with -Onone")
    }
}

C()
sleep(2)
Terms of Service

Privacy Policy

Cookie Policy