Coercion problems on Linux

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).

Pushkar N Kulkarni,

IBM Runtimes

Simplicity is prerequisite for reliability - Edsger W. Dijkstra

Is there any general approach you'd suggest to work around this coercion limitation 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@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: [SR-2477] NumberFormatter.string(for:) only works with NSNumber · Issue #4333 · apple/swift-corelibs-foundation · GitHub (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

Hi Philippe,

Thanks for your response! I have one more question.

Will we have it in future? Pardon my ignorance.

Pushkar N Kulkarni,

IBM Runtimes

Simplicity is prerequisite for reliability - Edsger W. Dijkstra

>> In general it is because we don't have bridging 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@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).

Pushkar N Kulkarni,

IBM Runtimes

Simplicity is prerequisite for reliability - Edsger W. Dijkstra

Is there any general approach you'd suggest to work around this coercion limitation on Linux?

To: Pushkar N Kulkarni/India/IBM@IBMIN
From: Philippe Hausler
Sent by: phausler@apple.com
Date: 09/08/2016 09:11PM
Cc: Tony Parker anthony.parker@apple.com, Swift corelibs dev swift-corelibs-dev@swift.org
Subject: Re: Coercion problems on Linux

-----phausler@apple.com wrote: -----

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.

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@apple.com wrote: -----
To: Pushkar N Kulkarni/India/IBM@IBMIN
From: Philippe Hausler
Sent by: phausler@apple.com
Date: 09/08/2016 09:11PM
Cc: Tony Parker <anthony.parker@apple.com>, Swift corelibs dev <swift-corelibs-dev@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

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: [SR-2477] NumberFormatter.string(for:) only works with NSNumber · Issue #4333 · apple/swift-corelibs-foundation · GitHub (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

···

Sent from my iPhone

On Sep 8, 2016, at 11:03 AM, Pushkar N Kulkarni <pushkar.nk@in.ibm.com> wrote:

On Sep 8, 2016, at 8:36 AM, Pushkar N Kulkarni <pushkar.nk@in.ibm.com> wrote: