You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_ =T.addWithOverflow(x, x) // expected-error {{'addWithOverflow' is unavailable: Please use FixedWidthInteger protocol as a generic constraint and addingReportingOverflow(_:) method instead.}}
5
+
_ =T.subtractWithOverflow(x, x) // expected-error {{'subtractWithOverflow' is unavailable: Please use FixedWidthInteger protocol as a generic constraint and subtractingReportingOverflow(_:) method instead.}}
6
+
_ =T.multiplyWithOverflow(x, x) // expected-error {{'multiplyWithOverflow' is unavailable: Please use FixedWidthInteger protocol as a generic constraint and multipliedReportingOverflow(by:) method instead.}}
7
+
_ =T.divideWithOverflow(x, x) // expected-error {{'divideWithOverflow' is unavailable: Please use FixedWidthInteger protocol as a generic constraint and dividedReportingOverflow(by:) method instead.}}
8
+
_ =T.remainderWithOverflow(x, x) // expected-error {{'remainderWithOverflow' is unavailable: Please use FixedWidthInteger protocol as a generic constraint and remainderReportingOverflow(dividingBy:) method instead.}}
9
+
}
10
+
11
+
func f<T :FixedWidthInteger>(x:T){
12
+
_ =T.addWithOverflow(x, x) // no error
13
+
_ =T.subtractWithOverflow(x, x) // no error
14
+
_ =T.multiplyWithOverflow(x, x) // no error
15
+
_ =T.divideWithOverflow(x, x) // no error
16
+
_ =T.remainderWithOverflow(x, x) // no error
17
+
}
18
+
19
+
do{
20
+
let _:IntMax=0 // no error
21
+
let _:UIntMax=0 // no error
22
+
}
23
+
24
+
func integer<T :Integer>(x:T){} // no error
25
+
func integerArithmetic<T :IntegerArithmetic>(x:T){} // no error
26
+
func signedNumber<T :SignedNumber>(x:T){} // no error
27
+
func absoluteValuable<T :AbsoluteValuable>(x:T){} // no error
28
+
func _signedInteger<T :_SignedInteger>(x:T){} // no error
_ =T.addWithOverflow(x, x) // expected-error {{'addWithOverflow' is unavailable: Please use FixedWidthInteger protocol as a generic constraint and addingReportingOverflow(_:) method instead.}}
5
+
_ =T.subtractWithOverflow(x, x) // expected-error {{'subtractWithOverflow' is unavailable: Please use FixedWidthInteger protocol as a generic constraint and subtractingReportingOverflow(_:) method instead.}}
6
+
_ =T.multiplyWithOverflow(x, x) // expected-error {{'multiplyWithOverflow' is unavailable: Please use FixedWidthInteger protocol as a generic constraint and multipliedReportingOverflow(by:) method instead.}}
7
+
_ =T.divideWithOverflow(x, x) // expected-error {{'divideWithOverflow' is unavailable: Please use FixedWidthInteger protocol as a generic constraint and dividedReportingOverflow(by:) method instead.}}
8
+
_ =T.remainderWithOverflow(x, x) // expected-error {{'remainderWithOverflow' is unavailable: Please use FixedWidthInteger protocol as a generic constraint and remainderReportingOverflow(dividingBy:) method instead.}}
9
+
}
10
+
11
+
func f<T :FixedWidthInteger>(x:T){
12
+
_ =T.addWithOverflow(x, x) // expected-error {{'addWithOverflow' is unavailable: Use addingReportingOverflow(_:) instead.}}
13
+
_ =T.subtractWithOverflow(x, x) // expected-error {{'subtractWithOverflow' is unavailable: Use subtractingReportingOverflow(_:) instead.}}
14
+
_ =T.multiplyWithOverflow(x, x) // expected-error {{'multiplyWithOverflow' is unavailable: Use multipliedReportingOverflow(by:) instead.}}
15
+
_ =T.divideWithOverflow(x, x) // expected-error {{'divideWithOverflow' is unavailable: Use dividedReportingOverflow(by:) instead.}}
16
+
_ =T.remainderWithOverflow(x, x) // expected-error {{'remainderWithOverflow' is unavailable: Use remainderReportingOverflow(dividingBy:) instead.}}
17
+
}
18
+
19
+
do{
20
+
let _:IntMax=0 // expected-error {{'IntMax' has been renamed to 'Int64'}}
21
+
let _:UIntMax=0 // expected-error {{'UIntMax' has been renamed to 'UInt64'}}
22
+
}
23
+
24
+
func integer<T :Integer>(x:T){} // expected-error {{'Integer' has been renamed to 'BinaryInteger'}}
25
+
func integerArithmetic<T :IntegerArithmetic>(x:T){} // expected-error {{'IntegerArithmetic' has been renamed to 'BinaryInteger'}}
0 commit comments