[swift-users] Implicitly type conversion ?

adelzhang at qq.com adelzhang at qq.com
Thu Aug 18 11:18:55 CDT 2016

I am confused by the code snippet following:

     func foo(_ value: Int?) {
     	// do nothing

     let a: Int = 2
     foo(a) //  it works!

Why swift don't warn the type mismatch? I am woking on Xcode Version 7.3.1.

More information about the swift-users mailing list