[swift-evolution] Proposal: Add Flags to Disable [Optional] Conversions

Kenny Leung kenny_leung at pobox.com
Fri Dec 11 10:58:05 CST 2015


Yes!

> On Dec 9, 2015, at 3:10 PM, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I don’t like the idea of having different incompatible dialects, and behavior changing modes.  That said, I’m personally not opposed to providing functionality that would enable people to use a reduced subsets of the language, and have the compiler enforce it.  For example, I don’t have a problem with someone saying they never want to use the x!, as!, try! family and have the compiler tell them if they do.
> 
> In terms of how to express this, I’m not in love with modal compiler flags :-).  I’d much rather this sort of requirement be specified as a pragma-like construct that applies to an arbitrary scope (e.g. class or function body) or a whole file.  This keeps the code self describing.



More information about the swift-evolution mailing list