Commits

Doug Gregor committed 78b7bb4c4b9
[Type checker]: Implement 'join' for optional types and a special case for 'nil'. The join operation for optional types is straightforward to define/implement: join(T?, U) ::= join(T, U)? join(T, U?) ::= join(T, U)? join(T?, U?) ::= join(T, U)? As a special case in the constraint solver, handle the join of a 'nil' literal with a non-ExpressibleByNilLiteral-conforming concrete type 'T' to produce 'T?'. This allows us, e.g., infer [String?] for the expressions ["hello", nil] and true ? "hello" nil for example. Fixes rdar://problem/16326914.