[swift-evolution] Making `.self` After `Type` Optional

Brent Royal-Gordon brent at architechies.com
Wed Mar 9 15:14:20 CST 2016


> I would like to propose making `.self` After a Type optional when referencing Types in expressions.

> This has been confirmed as a bug, and the report can be seen here <https://bugs.swift.org/browse/SR-899>.
> 
> After a Twitter conversation with Joe Groff on the Swift team (https://twitter.com/jckarter/status/707287663586324481) it is determined that this requirement is due to difficulty disambiguating generics `Foo<T>` vs infix less-than operations `Foo < T`.

My understanding from previous Twitter discussions is that the primary reason for this feature is to keep you from writing `Foo` where you meant `Foo()`. That is, it's a deliberate design, meant to keep you from making mistakes. I suspect that you will have to overcome *that* impulse, not just any narrow parsing issue.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list