[swift-evolution] Why is the status of SE-0110 "implemented"?

Jens Persson jens at bitcycle.com
Sat Jun 3 17:47:52 CDT 2017


Yes of course, try my demonstration code yourself.
(In the current dev snapshots, -swift-version 4 is the default and
-swift-version 3 is what you need to set if you want 3 compability)

On Sun, Jun 4, 2017 at 12:37 AM, Ben Rimmington <me at benrimmington.com>
wrote:

> Are you using the Swift 4 language mode?
>
> <https://swift.org/blog/swift-4-0-release-process/#source-compatibility>
>
> -- Ben
>
> > On 3 Jun 2017, at 23:01, Jens Persson wrote:
> >
> > I was notified that my SR-2216 and SR-296 had been "fixed as part of
> implementing SE-0110".
> >
> > But AFAICT SE-0110 can't possibly be fully implemented in dev snapshot
> 2017-06-02, even though the status of SE-0110 is "Implemented (Swift 4)".
> >
> >
> > The title of SE-0110 is
> > "Distinguish between single-tuple and multiple-argument function types"
> >
> > Keep that in mind while observing the following demonstration of the
> (Swift 4) behavior of Developer Snapshot 2017-06-02 (a):
> >
> > func f(_ a: Int, _ b: Int) { print("\(a), \(b)") }
> > func g(_ tuple: (Int, Int)) { print("\(tuple)") }
> > f(1, 2) // 1, 2
> > g((1, 2)) // (1, 2)
> > // Working as expected.
> >
> > // But:
> > print(type(of: f) == type(of: g)) // true
> > // IMHO this is not how to properly
> > // "Distinguish between single-tuple and multiple-argument function
> types"
> >
> > // And as if that wasn't enough (pay close attention):
> > var (fCopy, gCopy) = (f, g)
> > fCopy(1, 2) // 1, 2
> > gCopy((1, 2)) // (1, 2)
> > swap(&fCopy, &gCopy)
> > fCopy(1, 2) // (1, 2)
> > gCopy((1, 2)) // 1, 2
> > // Crazy!
> >
> > I'm trying to put this behavior and the following pieces together:
> >
> > 1. The introdoction from SE-0110:
> > "Swift's type system should properly distinguish between functions that
> take one tuple argument, and functions that take multiple arguments."
> >
> > 2. The status of SE-0110:
> > Implemented (Swift 4)
> >
> > 3. The "fixed as part of implementing SE-0110" notification of my bug
> reports
> > SR-2216: Confusing behavior related to closure types and tuples
> > SR-296: Fix inconsistencies related to tuples, arg/param lists, type
> params, typealiases
> >
> >
> > Perhaps SE-0110 is just not fully implemented in dev snapshot
> 2017-06-02, but it is implemented somewhere, why else should it get the
> status "implemented"?
> >
> > But then I read the following by Vladimir S (one of the SE-0110
> authors?):
> > https://lists.swift.org/pipermail/swift-evolution/
> Week-of-Mon-20170529/036965.html
> >
> > It's a very interesting read, and it's nice to see these old
> inconsistencies are getting some attention (they deserve all the attention
> they can get), but I'm still confused.
> >
> > Is it possible to implement SE-0110 without sorting out the above
> demonstrated inconsistencies?
> >
> > Should status of SE-0110 really be "Implemented"?
> >
> > /Jens
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170604/8f80cd8b/attachment.html>


More information about the swift-evolution mailing list