-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Description
Previous ID | SR-6245 |
Radar | None |
Original Reporter | @iby |
Type | Bug |
Status | Resolved |
Resolution | Done |
Additional Detail from JIRA
Votes | 0 |
Component/s | |
Labels | Bug |
Assignee | None |
Priority | Medium |
md5: 8123dfa5867b9577ae49cfb6f245273e
Issue Description:
Consider the following:
class Foo
{
init(x: UnsafeMutablePointer<Int>) {
self.x = x
}
deinit {
Swift.print("Oh boy…", self.x)
}
var x: UnsafeMutablePointer<Int>
}
class Bar: Foo
{
init?(p: Int?) throws {
if p == nil {
Swift.print("Erroring…")
throw E.any
}
var x: Int = 1
super.init(x: &x)
}
convenience init?() throws {
try self.init(p: nil)
}
}
enum E: Error
{
case any
}
_ = try? Bar()
It outputs:
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.