Files
swift-mirror/test/SILOptimizer/definite-init-try-in-self-init-argument.swift
Joe Groff 6e9a428543 DefiniteInitialization: Storing back to the 'self' box in a class init is OK.
SILGen does this now to maintain ownership balance when a class initializer delegation gets interrupted, such as by an error propagation through one of the arguments to the delegatee. Fixes rdar://problem/37007554 .
2018-02-03 10:01:15 -08:00

13 lines
201 B
Swift

// RUN: %target-swift-frontend -emit-sil -verify %s
class Y: X {
required init(_: Z) throws {
try super.init(Z())
}
}
class Z { init() throws {} }
class X {
required init(_: Z) throws {}
}