Not sure I am loving Swift 2's typeless throws; certainly doesn't help safety. Add to your ErrorType enum and no compiler errors! #wwdc
@mjtsai If you had to specify "throws MyErrorType" (Javaaaa!) it can exhaustively check catch without a default. Add to enum -> boom, error.
-
-
@twostraws That wouldn't work with an enum defined in Cocoa, because a later version of the OS could add to the enum after compilation. -
@mjtsai Somehow manages to work fine in other languages :) -
@mjtsai Perhaps they could allow both: "throws" for "may change externally to you", and "throws X" when it's your own code. -
@mjtsai The existence of "try!" shows willingness to cater for code working within known parameters. Maybe I'm just hoping against hope…
-
-
@twostraws@mjtsai that would help with inference too
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Paul Hudson
Michael Tsai
Greg Lhotellier