Files
swift-mirror/test/SILOptimizer/definite_init_extension.swift
Michael Gottesman 2cacbc6403 [di] Enable SIL Ownership verification on all definite init tests.
*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
2017-09-06 16:31:20 -07:00

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}}
}