Skip to content

Commit 60ab6db

Browse files
[tests] Adding function overload test cases
1 parent 3f39531 commit 60ab6db

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/expr/cast/as_coerce.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,17 @@ func f11295_Overload(c: Double, d: Double) -> Double { }
215215
_ = (f11295_Overload as (Int, Int) -> Int)(0, 0)
216216
_ = (f11295_Overload as (Double, Double) -> Double)(0, 0)
217217

218-
_ = (1 - 2 / 3 * 6) as UInt
218+
_ = (1 - 2 / 3 * 6) as UInt // OK
219219
_ = 1/4 as Float > 3/2 as Float // Ok
220220
_ = 1/4 as Int > 3/2 as Int // Ok
221221

222+
// Function overload
223+
func f11295_overload() -> Int { 0 }
224+
func f11295_overload() -> Double { 0.0 }
225+
226+
_ = f11295_overload() as Int // OK
227+
_ = f11295_overload() as Double // OK
228+
222229
// Coerce tuple elements
223230
func f11295_Tuple(_ a: (Int, Int)){}
224231
func f11295_TupleGeneric<T>(_ a: (T, T)){}

0 commit comments

Comments
 (0)