[swift-evolution] modifying Array<Element> to return Element! when subscripted

Pranjal Satija pranjal.satija at icloud.com
Thu Jun 23 11:07:48 CDT 2016


Would modifying array subscripts to return implicitly unwrapped optionals be a bad idea? This way, if an array is indexed out of bounds, the returned value will be nil, instead of a fatal error. This would allow developers to check for nil before fatal errors are created.


More information about the swift-evolution mailing list