Closed
Description
Previous ID | SR-11511 |
Radar | None |
Original Reporter | @BasThomas |
Type | Improvement |
Status | Resolved |
Resolution | Done |
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Improvement, StarterBug |
Assignee | jder (JIRA) |
Priority | Medium |
md5: ebcfa84ec27da83a255c80a10ed317da
Issue Description:
let optOne: Int? = 1
let y = optOne.map { _ in return () } // Constant 'y' inferred to have type '()?', which may be unexpected
let z = [""].map { _ in return () } // no warning.
// The expected warning would be:
// Constant 'z' inferred to have type '[()]', which may be unexpected
For more information see the thread in this tweet.