mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
*NOTE* DefiniteInit is still running /after/ ownership is stripped. This is just making sure that the code we are producing can actually pass the verifier. rdar://31521023
17 lines
374 B
Swift
17 lines
374 B
Swift
// RUN: %target-swift-frontend -emit-sil -enable-sil-ownership -verify %s -o /dev/null
|
|
|
|
struct S<T> {
|
|
let t: T // expected-note {{'self.t.1' not initialized}}
|
|
}
|
|
|
|
extension S where T == (Int, String) {
|
|
init(x: ()) {
|
|
t.0 = 1
|
|
t.1 = "hi"
|
|
}
|
|
|
|
init(y: ()) {
|
|
t.0 = 1
|
|
} // expected-error {{return from initializer without initializing all stored properties}}
|
|
}
|