Files
swift-mirror/test/SILOptimizer/definite_init_extension.swift
Slava Pestov 786d87b9bb DI: Operate on substituted field types
When adding a designated initializer to a nominal type in another
module, we would call getType() on deserialized VarDecls, which
is not allowed.

Instead, it is more correct to use SILTypes throughout and call
SILType::getFieldType() to get a substituted field type.

Fixes <https://bugs.swift.org/browse/SR-3545>.
2017-01-04 21:30:21 -08:00

17 lines
352 B
Swift

// RUN: %target-swift-frontend -emit-sil -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}}
}