Skip to content

Commit 00f0d3a

Browse files
committed
[Tests] NFC: Add a few test-cases that should type-check successfully
1 parent 05798e5 commit 00f0d3a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/Constraints/implicit_double_cgfloat_conversion.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,15 @@ func test_init_validation() {
349349
}
350350
}
351351
}
352+
353+
func test_ternary_and_nil_coalescing() {
354+
func test(_: Double?) {}
355+
356+
func ternary(v: CGFloat) {
357+
test(true ? v : nil) // Ok
358+
}
359+
360+
func test_nil_coalescing(v: CGFloat?) {
361+
test(v ?? 0.0) // Ok
362+
}
363+
}

0 commit comments

Comments
 (0)