File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -266,6 +266,9 @@ extension ${TraversalCollection} where Self : LazyCollectionProtocol {
266
266
267
267
% end
268
268
269
+ extension Slice : LazySequenceProtocol where Base: LazySequenceProtocol { }
270
+ extension Slice : LazyCollectionProtocol where Base: LazyCollectionProtocol { }
271
+
269
272
// ${'Local Variables'}:
270
273
// eval: (read-only-mode 1)
271
274
// End:
Original file line number Diff line number Diff line change
1
+ // RUN: rm -rf %t ; mkdir -p %t
2
+ // RUN: %target-build-swift %s -o %t/a.out3 -swift-version 3 && %target-run %t/a.out3
3
+ // REQUIRES: executable_test
4
+
5
+ import StdlibUnittest
6
+
7
+ var tests = TestSuite ( " LazySlice " )
8
+
9
+ tests. test ( " CommuteLazyness " ) {
10
+ let a = [ 1 , 2 , 3 ] . lazy
11
+ let b = a [ ... ]
12
+ var c = b. filter { $0 == 0 }
13
+ // NOTE, this test will fail once lazy collectionness becomes a conditiona
14
+ // conformance, and will need updating to be a LazyBidirectional thingy
15
+ expectType ( LazyFilterBidirectionalCollection< Slice< LazyRandomAccessCollection< [ Int] >>> . self , & c)
16
+ }
17
+
18
+ runAllTests ( )
You can’t perform that action at this time.
0 commit comments