File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1- // RUN: %target-swift-frontend -emit-sil %s -verify -sil-verify-all
1+ // RUN: %target-swift-frontend -emit-sil %s -verify -sil-verify-all -disable-availability-checking
22
33////////////////////////
44// MARK: Declarations //
@@ -997,3 +997,17 @@ struct TrivialSelfTest {
997997}
998998
999999func consumeTrivialSelfTest( _ x: consuming TrivialSelfTest ) { }
1000+
1001+ extension AsyncSequence where Element: Sendable {
1002+ consuming func iterate_bad( ) async { // expected-error {{missing reinitialization of inout parameter 'self' after consume}}
1003+ await withTaskGroup ( of: Void . self) { _ in
1004+ var _: AsyncIterator = self . makeAsyncIterator ( ) // expected-note {{consumed here}}
1005+ }
1006+ }
1007+
1008+ consuming func iterate_fixed( ) async {
1009+ await withTaskGroup ( of: Void . self) { [ seq = copy self] _ in
1010+ var _: AsyncIterator = seq. makeAsyncIterator ( )
1011+ }
1012+ }
1013+ }
You can’t perform that action at this time.
0 commit comments