File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -68,3 +68,13 @@ class MoviesViewController {
68
68
_ = itemType // expected-error {{ambiguous use of 'itemType'}}
69
69
}
70
70
}
71
+
72
+ // SR-15053
73
+ func SR15053< T : Numeric > ( _ a: T , _ b: T ) -> T {
74
+ ( a + b) / 2 // expected-error{{cannot convert return expression of type 'Int' to return type 'T'}}
75
+ // expected-error@-1{{cannot convert value of type 'T' to expected argument type 'Int'}}
76
+ }
77
+
78
+ func SR15053< T : Numeric > ( _ a: T , _ b: T ) {
79
+ ( a + b) / 2 // expected-error{{cannot convert value of type 'T' to expected argument type 'Int'}}
80
+ }
Original file line number Diff line number Diff line change @@ -6,6 +6,6 @@ import Foundation
6
6
struct S {
7
7
init < T: NSNumber > ( _ num: T ) { // expected-note {{where 'T' = 'Bool'}}
8
8
self . init ( num != 0 ) // expected-error {{initializer 'init(_:)' requires that 'Bool' inherit from 'NSNumber'}}
9
- // expected-error@-1 {{referencing operator function '!=' on 'BinaryInteger' requires that 'T' conform to 'BinaryInteger '}}
9
+ // expected-error@-1 {{cannot convert value of type 'T' to expected argument type 'Int '}}
10
10
}
11
11
}
You can’t perform that action at this time.
0 commit comments