<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<div>Why does this compile?</div><div><br /></div><div>let t1: Int? = 2</div><div>print(t1 ?? "asdf")</div><div><br /></div><div>The type of ?? is this:</div><div><br /></div><div>@warn_unused_result</div><div>public func ??<T>(optional: T?, @autoclosure defaultValue: () throws -> T) rethrows -> T</div><div><br /></div><div>The type syas that T must be the same type throughout. But above I could successfully use Int? and then String. Why?</div> </body>
</html>