Why does this compile?
let t1: Int? = 2print(t1 ?? "asdf")
The type of ?? is this:
@warn_unused_resultpublic func ??<T>(optional: T?, @autoclosure defaultValue: 
() throws -> T) rethrows -> T
The type syas that T must be the same type throughout. But above I could 
successfully use Int? and then String. Why?
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to