File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %target-typecheck-verify-swift
2+
3+ @yield_once func coro( _ x : inout Float ) -> inout @yields Float {
4+ var _x = Float ( 0.0 )
5+ yield & _x
6+ x = Float ( _x)
7+ }
8+
9+ func retCoro( ) -> @yield_once ( _ x : inout Float ) -> inout @yields Float {
10+ return coro
11+ }
12+
13+ @yield_once func coroWithResult( _ x : Float ) -> ( yield: inout @yields Float , result: Float ) {
14+ var _x = Float ( 0.0 )
15+ yield & _x
16+ return _x
17+ }
18+
19+ func retCoroWithResult( ) -> @yield_once ( _ x : Float ) -> ( inout @yields Float , Float ) {
20+ return coroWithResult
21+ }
22+
23+ @yield_once func coroGen< T> ( _ x : inout T ) -> inout @yields T {
24+ var _x = x
25+ yield & _x
26+ x = _x
27+ }
28+
29+ func retGenCoro< T> ( ) -> @yield_once ( _ x : inout T ) -> inout @yields T {
30+ return coroGen
31+ }
32+
33+ @yield_once func coroGenWithResult< T> ( _ x : T ) -> ( yield: inout @yields T , result: T ) {
34+ var _x = x
35+ yield & _x
36+ return _x
37+ }
38+
39+ func retCoroGenWithResult< T> ( ) -> @yield_once ( _ x : T ) -> ( inout @yields T , T ) {
40+ return coroGenWithResult
41+ }
You can’t perform that action at this time.
0 commit comments