<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 6, 2015, at 11:49 PM, David Hart via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I’m looking at the special case of library code. If I surface an API in a library, it’s the library user who will call this function. Would you regard this as an assert or throws scenario?</span></div></blockquote></div><br class=""><div class="">Assert. It’s not library vs. non-library, it’s a question of bug vs. legitimate runtime error. Passing an invalid parameter value is a bug.</div><div class=""><br class=""></div><div class="">For example, Foundation is a library, and passing an invalid parameter to a Foundation method triggers an assertion failure.</div><div class=""><br class=""></div><div class="">—Jens</div></body></html>