Skip to content

Commit 693a4c1

Browse files
committed
Work Around +asserts Canonicalization Differences in Substitution
On +asserts builds, this code public struct MemberInits<Value : Equatable> { fileprivate var value: String = "default" } extension MemberInits { public init<T>(_ array: [MemberInits<T>]) where Value == [T] {} } Produces an apply of the memberwise initializer substituting BoundGenericType, on -asserts builds it produces a substitution of an ArraySliceType. This suggests we have an assertion that is mutating the substitution map somewhere. For now, switch to an explicit BoundGenericType to homogenize this test while I'm looking into why this happens.
1 parent b6f0ff7 commit 693a4c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/SILGen/initializers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ class MemberInitsHelper<T> { }
11361136

11371137
extension MemberInits {
11381138
// CHECK-LABEL: sil [ossa] @$s21failable_initializers11MemberInitsVyACySayqd__GGSayACyqd__GGcADRszSQRd__lufC : $@convention(method) <Value><T where Value == Array<T>, T : Equatable> (@owned Array<MemberInits<T>>, @thin MemberInits<Array<T>>.Type) -> @owned MemberInits<Array<T>> {
1139-
public init<T>(_ array: [MemberInits<T>]) where Value == [T] {
1139+
public init<T>(_ array: Array<MemberInits<T>>) where Value == [T] {
11401140
box = nil
11411141

11421142
// CHECK: [[INIT_FN:%.*]] = function_ref @$s21failable_initializers11MemberInitsV5value33_4497B2E9306011E5BAC13C07BEAC2557LLSSvpfi : $@convention(thin) <τ_0_0 where τ_0_0 : Equatable> () -> @owned String

0 commit comments

Comments
 (0)