File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -751,6 +751,22 @@ public class TestImplicitCaptureOfExplicitCaptureOfSelfInEscapingClosure {
751
751
return s. isEmpty
752
752
} . filter { $0 }
753
753
754
+ func producer< T> ( _ f: ( String ) -> T ) -> T { }
755
+ func f59716( ) -> some BinaryInteger { // expected-note{{required by opaque return type of global function 'f59716()'}}
756
+ // expected-note@+1{{only concrete types such as structs, enums and classes can conform to protocols}}
757
+ return producer { s in // expected-error{{type '()' cannot conform to 'BinaryInteger'}}
758
+ if s == " 1 " { return }
759
+ return s. count // expected-error{{cannot convert value of type 'Int' to closure result type '()'}}
760
+ }
761
+ }
762
+
763
+ func f59716_1( ) -> some BinaryInteger {
764
+ return producer { s in
765
+ if s == " 1 " { return 1 }
766
+ return s. count
767
+ }
768
+ }
769
+
754
770
// https://github.com/apple/swift/issues/60781
755
771
func f60781< T> ( _ x: T ) -> T { x }
756
772
func f60781< T> ( _ x: T , _ y: T ) -> T { x }
You can’t perform that action at this time.
0 commit comments