<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">This is my first proposal to swift-corelibs, so I’m not sure how much flexibility we have in terms of deviating from the darwin’s original Foundation definitions. &nbsp;That said, it’s always seemed a little screwy to me that&nbsp;NSTask's standardInput/standardOutput/standardError properties sacrifice any semblance of compile-time type safety by accepting id/AnyObject (which, at run time, must be either NSPipe or NSFileHandle, else it blows up). &nbsp;If allowed, I’d like to take the opportunity to modernize this in the open source version of Foundation.<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">public</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">class</span> NSTask : <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">NSObject</span> {</div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class="">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class="">... &nbsp; &nbsp;<br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162);" class="">public</span> <span style="color: rgb(187, 44, 162);" class="">enum</span> IOType {</div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class="">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">case</span> FileHandle(NSFileHandle)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">case</span> Pipe(NSPipe)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; }</div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class="">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class="">&nbsp; &nbsp;&nbsp;<span style="color: rgb(187, 44, 162);" class="">public</span> <span style="color: rgb(187, 44, 162);" class="">var</span> standardInput: <span style="color: rgb(79, 129, 135);" class="">NSTask</span>.<span style="color: rgb(79, 129, 135);" class="">IOType</span>?</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">public</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span> standardOutput: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">NSTask</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">IOType</span>?</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">public</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span> standardError: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">NSTask</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">IOType</span>?</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">...</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class="">&nbsp; &nbsp;<br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div></div><div class=""><br class=""></div><div class="">Dan</div></body></html>