<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=""><div class="">We had changed the return type of JSONSerialization to be Any such that it avoided the caller needing to bridge types (which works poorly on linux). Even though this is an API change technically, just change the return type to match the other JSONSerialization methods.</div><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 15, 2016, at 12:44 AM, Mamatha Busi via swift-corelibs-dev <<a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="socmaildefaultfont" dir="ltr" style="font-family:Arial;font-size:10.5pt"><div class="socmaildefaultfont" dir="ltr" style="font-family:Arial;font-size:10.5pt"><div dir="ltr" class=""><div class="">Hi</div>
<div class=""> </div>
<div class="">Trying to implement the JSONSerialization unimplemented method jsonObject(withStream). </div>
<div class=""> </div>
<div class=""><em class=""> JSONSerialization.jsonObject(with stream: InputStream, options opt: ReadingOptions = []) throws -> AnyObject</em></div>
<div class=""> </div>
<div class="">The comments in the source code mentions that apart from stream configuration all other behaviour of this method is the same as the JSONObjectWithData:options:error.<br class="">This implies that I can internally reuse the JSONObjectWithData method, however its return type is ‘Any’ whereas the return type in jsonObjectWithStream is ‘AnyObject’. As I cannot downcast ‘Any’ to ‘AnyObject’, I’m looking for inputs if I should rewrite the behaviour or is there any other way?</div>
<div class=""> </div>
<div class="">Thank you.</div>
<div class=""> </div>
<div class="">-Mamatha.</div></div></div></div><br class="">
_______________________________________________<br class="">swift-corelibs-dev mailing list<br class=""><a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev<br class=""></div></blockquote></div><br class=""></body></html>