[swift-corelibs-dev] Coercion problems on Linux

Philippe Hausler phausler at apple.com
Thu Sep 8 13:33:32 CDT 2016


>From a technical perspective it is not impossible to do however as of current reference type to structural type bridging is conflated with the objective c runtime being present (specifically present on Darwin targets). Personally I think we need a better answer than what we have today but I don't see the winds changing in the immediate future to support ref type bridges uniformly in a cross platform manner. So the only recourse from what I can imagine is to make methods that take Any really respond to any via internal reinterpretation. The return types however are a different story since that makes a requirement on the caller to do the "right" thing.

Sent from my iPhone

> On Sep 8, 2016, at 11:03 AM, Pushkar N Kulkarni <pushkar.nk at in.ibm.com> wrote:
> 
> Hi Philippe, 
> 
> Thanks for your response! I have one more question.
> 
> >> In general it is because we don't have bridging on Linux.
> Will we have it in future? Pardon my ignorance. 
> 
> Pushkar N Kulkarni,
> IBM Runtimes
> 
> Simplicity is prerequisite for reliability - Edsger W. Dijkstra
> 
> 
> 
> -----phausler at apple.com wrote: -----
> To: Pushkar N Kulkarni/India/IBM at IBMIN
> From: Philippe Hausler 
> Sent by: phausler at apple.com
> Date: 09/08/2016 09:11PM
> Cc: Tony Parker <anthony.parker at apple.com>, Swift corelibs dev <swift-corelibs-dev at swift.org>
> Subject: Re: Coercion problems on Linux
> 
> That particular issue we could plaster over with generics. In general it is because we don't have bridging on Linux.
> 
> Sent from my iPhone
> 
>> On Sep 8, 2016, at 8:36 AM, Pushkar N Kulkarni <pushkar.nk at in.ibm.com> wrote:
>> 
>> Hi Tony/Philippe, 
>> 
>> There've been a few bug reports related to the coercion problems between Swift and Foundation types on Linux. For example this one: https://bugs.swift.org/browse/SR-2477 (Double/Int don't coerce with NSNumber on Linux). 
>> 
>> Is there any general approach you'd suggest to work around this coercion limitation on Linux?
>> 
>> Pushkar N Kulkarni,
>> IBM Runtimes
>> 
>> Simplicity is prerequisite for reliability - Edsger W. Dijkstra
>> 
>> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20160908/72c6903d/attachment.html>


More information about the swift-corelibs-dev mailing list