File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -532,3 +532,26 @@ r32432145 { _,_ in
532
532
// rdar://problem/30106822 - Swift ignores type error in closure and presents a bogus error about the caller
533
533
[ 1 , 2 ] . first { $0. foo = 3 }
534
534
// expected-error@-1 {{value of type 'Int' has no member 'foo'}}
535
+
536
+ // rdar://problem/32433193, SR-5030 - Higher-order function diagnostic mentions the wrong contextual type conversion problem
537
+ protocol A_SR_5030 {
538
+ associatedtype Value
539
+ func map< U> ( _ t : @escaping ( Self . Value ) -> U ) -> B_SR_5030 < U >
540
+ }
541
+
542
+ struct B_SR_5030 < T> : A_SR_5030 {
543
+ typealias Value = T
544
+ func map< U> ( _ t : @escaping ( T ) -> U ) -> B_SR_5030 < U > { fatalError ( ) }
545
+ }
546
+
547
+ func sr5030_exFalso< T> ( ) -> T {
548
+ fatalError ( )
549
+ }
550
+
551
+ extension A_SR_5030 {
552
+ func foo( ) -> B_SR_5030 < Int > {
553
+ let tt : B_SR_5030 < Int > = sr5030_exFalso ( )
554
+ return tt. map { x in ( idx: x) }
555
+ // expected-error@-1 {{cannot convert value of type '(idx: (Int))' to closure result type 'Int'}}
556
+ }
557
+ }
You can’t perform that action at this time.
0 commit comments