> On 9 Nov 2016, at 16:55, Karl <raziel.im+swift-...@gmail.com> wrote:
> 
> If the compiler can’t infer T (such as “let a = nil”), it should fall-back to 
> Optional<Any>.none; I’m very surprised that this isn’t the case currently.
> 

Oh, it is the case currently:

let a = nil
error: repl.swift:1:9: error: 'nil' requires a contextual type

I’m not familiar with why the compiler needs _OptionalNilComparisonType in 
order to compare to “nil”, but I would guess it could be improved to recognise 
the literal natively if removing this protocol is a significant concern.

- Karl
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to