File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
validation-test/compiler_crashers_2_fixed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -4761,7 +4761,7 @@ bool ConstraintSystem::repairFailures(
4761
4761
path.pop_back ();
4762
4762
4763
4763
// Drop the tuple type path elements too, but extract each tuple type first.
4764
- if (path.back ().is <LocatorPathElt::TupleType>()) {
4764
+ if (!path. empty () && path.back ().is <LocatorPathElt::TupleType>()) {
4765
4765
rhs = path.back ().getAs <LocatorPathElt::TupleType>()->getType ();
4766
4766
path.pop_back ();
4767
4767
lhs = path.back ().getAs <LocatorPathElt::TupleType>()->getType ();
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -typecheck -verify %s
2
+
3
+ struct S {
4
+ private let data : [ [ String ] ]
5
+ private func f( ) { }
6
+
7
+ func test( ) {
8
+ // expected-error@+1 {{static method 'buildBlock' requires that 'ForEach<[String], ()>' conform to 'View'}}
9
+ ForEach ( data) { group in
10
+ ForEach ( group) { month in
11
+ self . f ( )
12
+ }
13
+ }
14
+ }
15
+ }
16
+
17
+ struct Wrapper < T> { }
18
+
19
+ protocol View { }
20
+
21
+ @resultBuilder struct Builder {
22
+ // expected-note@+1 {{where 'Content' = 'ForEach<[String], ()>'}}
23
+ static func buildBlock< Content: View > ( _ content: Content ) -> Content { fatalError ( ) }
24
+ }
25
+
26
+ struct ForEach < Data, Content> where Data : RandomAccessCollection {
27
+ init < C> ( _ data: Wrapper < C > , @Builder content: ( Wrapper < C . Element > ) -> Content ) where C : MutableCollection { }
28
+ init ( _ data: Data , @Builder content: @escaping ( Data . Element ) -> Content ) { }
29
+ }
You can’t perform that action at this time.
0 commit comments