Skip to content

Commit b7fcae4

Browse files
committed
[Diagnostics] NFC: Adjust a couple of tests which are now valid due to implicit CGFloat conversion
1 parent 73084e7 commit b7fcae4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/Constraints/bridging.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ let d2: Double = 3.14159
208208
inferDouble2 = d2
209209

210210
// rdar://problem/18269449
211-
var i1: Int = 1.5 * 3.5 // expected-error {{cannot convert value of type 'Double' to specified type 'Int'}}
211+
var i1: Int = 1.5 * 3.5 // Ok (Double -> CGFloat for each argument, CGFloat -> Int for the result)
212212

213213
// rdar://problem/18330319
214214
func rdar18330319(_ s: String, d: [String : AnyObject]) {

test/Misc/misc_diagnostics.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ if let realRoomName = roomName as! NSString { // expected-warning{{forced cast f
1717

1818
var pi = 3.14159265358979
1919
var d: CGFloat = 2.0
20-
var dpi:CGFloat = d*pi // expected-error@:21{{cannot convert value of type 'Double' to expected argument type 'CGFloat'}}
20+
var dpi:CGFloat = d*pi // Ok (implicit conversion Float -> CGFloat)
2121

22-
let ff: CGFloat = floorf(20.0) // expected-error{{cannot convert value of type 'Float' to specified type 'CGFloat'}}
22+
let ff: CGFloat = floorf(20.0) // Ok (implicit conversion Float -> CGFloat)
2323

2424
let total = 15.0
2525
let count = 7
@@ -34,7 +34,7 @@ var b: Int = [1, 2, 3] // expected-error{{cannot convert value of type '[Int]' t
3434
var f1: Float = 2.0
3535
var f2: Float = 3.0
3636

37-
var dd: Double = f1 - f2 // expected-error{{cannot convert value of type 'Float' to specified type 'Double'}}
37+
var dd: Double = f1 - f2 // Ok (implicit conversion Float -> CGFloat for each argument and CGFloat -> Double for the result)
3838

3939
func f() -> Bool {
4040
return 1 + 1 // expected-error{{type 'Int' cannot be used as a boolean; test for '!= 0' instead}}

0 commit comments

Comments
 (0)