File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -694,3 +694,28 @@ func test_recursive_var_reference_in_multistatement_closure() {
694694 }
695695 }
696696}
697+
698+ // https://github.com/apple/swift/issues/67363
699+ func test_result_builder_in_member_chaining( ) {
700+ @resultBuilder
701+ struct Builder {
702+ static func buildBlock< T> ( _: T ) -> Int { 42 }
703+ }
704+
705+ struct Test {
706+ static func test< T> ( fn: ( ) -> T ) -> T {
707+ fn ( )
708+ }
709+
710+ func builder( @Builder _: ( ) -> Int ) { }
711+ }
712+
713+ Test . test {
714+ let test = Test ( )
715+ return test
716+ // FIXME: This call should type-check, currently closure is resolved before overload of `builder` is picked.
717+ } . builder { // expected-error {{cannot convert value of type '()' to closure result type 'Int'}}
718+ let result = " "
719+ result
720+ }
721+ }
You can’t perform that action at this time.
0 commit comments