<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>At this point I think it's worth actually finding out how much code this would impact in practice. Not just in the stdlib, but in third-party applications and libraries.<br></div>
<div>&nbsp;</div>
<div>This could be done by putting this feature into the language, but requiring a swiftc flag to turn it on. The stdlib would have to be annotated with @allow_unused_result (or whatever we call it) in the right places, such as in pop(), but I suspect that there's relatively few APIs in the stdlib that need this annotation.<br></div>
<div>&nbsp;</div>
<div>We can then tell people to try adding the flag and seeing how many warnings they get in their code, and to then figure out how many of the warnings are potentially useful (e.g. methods where it's reasonable to have the warning even if the code wants to ignore it at that moment) vs how many are bad (such as pop(), where ignoring the return value is perfectly reasonable in many cases). Similarly, someone could run this flag against same projects for popular third-party libraries and see what pops up.<br></div>
<div>&nbsp;</div>
<div>-Kevin Ballard</div>
<div>&nbsp;</div>
</body>
</html>