You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sema: Harden 'for ... in ...' with existential type
Avoid calling lookupMemberType() with an existential base
altogether.
With the previous resolveTypeInContext() patch, a compiler_crasher
regressed and hit this, because the behavior of lookupMemberType()
changed to return nullptr in fewer cases.
Copy file name to clipboardExpand all lines: test/stmt/foreach.swift
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -172,3 +172,9 @@ func testOptionalSequence() {
172
172
}
173
173
}
174
174
175
+
// Crash with (invalid) for each over an existential
176
+
func testExistentialSequence(s:Sequence){ // expected-error {{protocol 'Sequence' can only be used as a generic constraint because it has Self or associated type requirements}}
177
+
forxin s { // expected-error {{using 'Sequence' as a concrete type conforming to protocol 'Sequence' is not supported}}
0 commit comments