Re: [swift-users] Canonical way to cast C structs

2016-09-13 Thread Andrew Trick via swift-users
> On Sep 12, 2016, at 12:39 PM, Bouke Haarsma via swift-users > wrote: > > Sorry for all the pings, but it appears that the code below doesn’t work > after all; > >> fatal error: can't unsafeBitCast between types of different sizes > > So the question remains on how to perform the casts usin

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Chris Lattner via swift-users
On Sep 13, 2016, at 5:34 PM, Shyamal Chandra wrote: > Hi Chris, > > Here is a forum question that I posted a while back. The latest post says to > file a bug under the bug report. > > Here's the post: > > https://forums.developer.apple.com/thread/61953 >

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Austin Zheng via swift-users
Hi Shyamal, Please share with us the SLA you signed with Apple that guarantees you any level of paid support with regards to Swift, or alternatively an invoice that shows us how much you paid for a license to use the Linux port of Swift. Best regards, Austin > On Sep 13, 2016, at 7:24 PM, Shya

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Jens Alfke via swift-users
> On Sep 13, 2016, at 7:24 PM, Shyamal Chandra wrote: > > Could you give me examples of what I said was clearly "unprofessional”? Well, starting with the title of the thread, as others have noted. You’re coming across as very confrontational and, well, entitled. > Two months for a bug becaus

Re: [swift-users] @escaping may only be applied to parameters of function type

2016-09-13 Thread Shawn Erickson via swift-users
I am in the process of updating to Xcode 8 release so I can't confirm at the moment but I am fairly sure I hit a situation with being asked to implement a func from a protocol that got autocompleted with @escape nested as shown. It would then of course complain that wasn't valid. If I fixed it I do

Re: [swift-users] @escaping may only be applied to parameters of function type

2016-09-13 Thread Michael Ilseman via swift-users
> On Sep 13, 2016, at 8:14 PM, Rick Mann wrote: > > But the Apple declaration (accessible via Xcode) of the method it's based on > looks like this: > > open func enumerator(at url: URL, >includingPropertiesForKeys keys: [URLResourceKey]?, >options mask: FileManager.DirectoryEnumeration

Re: [swift-users] @escaping may only be applied to parameters of function type

2016-09-13 Thread Rick Mann via swift-users
But the Apple declaration (accessible via Xcode) of the method it's based on looks like this: open func enumerator(at url: URL, includingPropertiesForKeys keys: [URLResourceKey]?, options mask: FileManager.DirectoryEnumerationOptions = [], errorHandler handler: (@escaping (URL, Error)

Re: [swift-users] @escaping may only be applied to parameters of function type

2016-09-13 Thread Michael Ilseman via swift-users
TL;DR: The optional is already escaping, due to the fact that “T?" is sugar for Optional, and the noescape-by-default rule only applies to types in immediate parameter position. Current Swift master has much better diagnostics for this case. There is not currently a general solution involving e

Re: [swift-users] @escaping may only be applied to parameters of function type

2016-09-13 Thread Shawn Erickson via swift-users
The following is the earlier thread I was talking about. [swift-users] Swift 3 (Xcode 8 GM) issue with @escaping -Shawn On Tue, Sep 13, 2016 at 7:31 PM Shawn Erickson wrote: > I hit this issue as well. I had an ea

Re: [swift-users] @escaping may only be applied to parameters of function type

2016-09-13 Thread Shawn Erickson via swift-users
I hit this issue as well. I had an early email on this list regarding do this topic, not in a situation to search for it. It is a short coming in how escaping can be applied to things like optional closures. I was in the process of authoring an email for swift evolution about it and haven't yet go

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Shyamal Chandra via swift-users
Hi Adam, What are you talking about? If swift.org bug reporting doesn't work, where do you go? You pay money for support but you don't get that from Apple. That's unprofessional by Apple; not my complaint that they don't handle the bug reports in a timely-fashion. Thanks! Best, Shyamal Chandr

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Adam Eberbach via swift-users
If you need yet another perspective, your tone does seem abrasive. This is not the place for regretting how Apple handles bug reports. Best regards, Adam Eberbach > On 14 Sep. 2016, at 12:24 pm, Shyamal Chandra via swift-users > wrote: > > Hi Shawn, > > Could you give me examples of what I s

[swift-users] @escaping may only be applied to parameters of function type

2016-09-13 Thread Rick Mann via swift-users
I'm trying to write this function. The errorHandler: parameter is modeled after the NSFileManager enumerate() function. If I include the @escaping you see there, I get the error "@escaping may only be applied to parameters of function type". The second parameter, iterator:, seems to have no pro

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Shyamal Chandra via swift-users
Hi Marco, Is there proper documentation for Swift open source? Is there design documents for the n-lines of code? Is there some clear commenting for every line of code? Thanks! Best, Shyamal Chandra shyam...@gmail.com Linkedin: http://www.linkedin.com/in/shyamalc Phone: 620-719-9064 On Tue,

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Shyamal Chandra via swift-users
Hi Shawn, Could you give me examples of what I said was clearly "unprofessional"? Two months for a bug because open source is "do it yourself". This sounds like a crappy support team by a large multinational company that open sources non-functional Linux ports of its language. I gave clear examp

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Marco S Hyman via swift-users
On Sep 13, 2016, at 6:53 PM, Shyamal Chandra via swift-users wrote: > > I am not arguing; I am bringing up defect in the Apple way of handling bugs > for Swift, Xcode, and Playgrounds. Am I supposed to wait for eternity? As Jens noted, you have to separate Swift from Xcode and Playgrounds.

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Shawn Erickson via swift-users
You message are really coming across with an unprofessional tone. I understand you are frustrated but folks inside and outside of Apple have been working their butts off and frankly deserve a little more civility. Anyway, the Linux side of things is very much an open source - do it yourself - type

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Shyamal Chandra via swift-users
I am not arguing; I am bringing up defect in the Apple way of handling bugs for Swift, Xcode, and Playgrounds. Am I supposed to wait for eternity? On Tuesday, September 13, 2016, Jens Alfke wrote: > > On Sep 13, 2016, at 6:27 PM, Shyamal Chandra > wrote: > > Do you really think that is a viabl

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Jens Alfke via swift-users
> On Sep 13, 2016, at 6:27 PM, Shyamal Chandra wrote: > > Do you really think that is a viable option again? No, you’re right. Reporting bugs is clearly the least viable option, except for all the other options* (like arguing on mailing lists.) —Jens * With apologies to Winston Churchill

Re: [swift-users] Method of same name is shadowing a property in Swift 3

2016-09-13 Thread Jens Alfke via swift-users
> On Sep 13, 2016, at 3:13 PM, Hooman Mehr wrote: > > I guess the reason this is happening is some attempt at backward > compatibility, but this is clearly causing a serious bug. Have you reported > it? I have now: https://bugs.swift.org/browse/SR-2633 —Jens__

[swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Shyamal Chandra via swift-users
I posted an error with ubuntu running on swift.org and it is currently medium priority and still hasn't been fixed by an "open source" team member and it has been more than two months. Here is the error: https://bugs.swift.org/browse/SR-1998 Do you really think that is a viable option again? On

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Jens Alfke via swift-users
> On Sep 13, 2016, at 5:34 PM, Shyamal Chandra via swift-users > wrote: > > Here is a forum question that I posted a while back. The latest post says to > file a bug under the bug report. I have had mixed success with the bug > reporter tool from Apple; most of the time, they ask for the sy

Re: [swift-users] Method of same name is shadowing a property in Swift 3

2016-09-13 Thread Jens Alfke via swift-users
> On Sep 13, 2016, at 4:47 PM, Zhao Xin wrote: > > You said your issue only existed in Swift 3. However, you issue still exists > in Xcode 7.3.1, which uses Swift 2.2. I tested your playground code. Interesting. I think the difference is that prior to Swift 3, the original Objective-C method

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Shyamal Chandra via swift-users
Hi Chris, Here is a forum question that I posted a while back. The latest post says to file a bug under the bug report. I have had mixed success with the bug reporter tool from Apple; most of the time, they ask for the system diagnostics and then, tell you to update your version. Sometimes, the

[swift-users] Swift 3.0 released!

2016-09-13 Thread Ted kremenek via swift-users
Hi everyone, Swift 3.0 has been officially released: https://swift.org/blog/swift-3-0-released/ This moment marks an incredible achievement for the Swift open source community. The release is the culmination of an incredible amount of discussion and implementation work to bring it all tog

Re: [swift-users] Swift and Xcode along with Playgrounds is full of bugs

2016-09-13 Thread Chris Lattner via swift-users
On Sep 12, 2016, at 3:03 PM, Shyamal Chandra via swift-users wrote: > Hope you are doing well! > > Swift is very volatile language that keeps on changing with every new version > of Xcode. When you are trying to run old code with different syntax, you run > into problems because the code is n

Re: [swift-users] Method of same name is shadowing a property in Swift 3

2016-09-13 Thread Zhao Xin via swift-users
You said your issue only existed in Swift 3. However, you issue still exists in Xcode 7.3.1, which uses Swift 2.2. I tested your playground code. protocol QueryRow { var key: Any { get } func key(at index: UInt) -> Any? } var row: QueryRow row.key as? String Zhaoxin On Wed, Sep 14, 201

Re: [swift-users] Method of same name is shadowing a property in Swift 3

2016-09-13 Thread Jens Alfke via swift-users
> On Sep 13, 2016, at 3:13 PM, Hooman Mehr wrote: > > I guess the reason this is happening is some attempt at backward > compatibility, but this is clearly causing a serious bug. Have you reported > it? No; I’m not a Swift expert, and am not following the 3.0 transition closely enough to tel

Re: [swift-users] Method of same name is shadowing a property in Swift 3

2016-09-13 Thread Hooman Mehr via swift-users
As I see it, this is serious bug. In Swift 3.0, parameter labels (or lack of them) are supposed to be a part of the function name. Otherwise, the two `key` definitions would create a name collision and should have been rejected in the first place. This should not happen, because only `key(at:)`

[swift-users] Method of same name is shadowing a property in Swift 3

2016-09-13 Thread Jens Alfke via swift-users
One of my co-workers just noticed a problem with the (bridged) API of our Objective-C framework, when used from Swift 3 (but not earlier). We have a class CBLQueryRow that includes the following: @property (readonly) id key; - (nullable id) keyAtIndex: (NSUInteger)index; In Swif

[swift-users] Canonical way to getifaddrs with SPM and Xcode

2016-09-13 Thread Bouke Haarsma via swift-users
Hi all, I would like to know the canonical way to call C’s getifaddrs, defined in ifaddr.h, using Swift 3. It should compile from both Xcode and SPM (Darwin and Glibc). As this header is not imported by the Darwin (/Glibc as well?) library, so the header would need to be imported by my own code

[swift-users] Canonical way to cast C structs

2016-09-13 Thread Bouke Haarsma via swift-users
Hi all, Inside my CFSocketCallBack a pointer to a sockaddr is provided wrapped in a CFData structure. The sockaddr could be either a sockaddr_in (IPv4) or sockaddr_in6 (IPv6) struct. In order to discover which struct you’re dealing with, the attribute sa_family can be inspected. In C this would

Re: [swift-users] Issues with UITableView*

2016-09-13 Thread Adam Stoller via swift-users
I will respond to this directly to Ole - as I was informed this was not the correct list for such discussions, and I have since unsubscribed and subscribed to the cocoa-dev list instead. Many thanks… —fish (Adam Stoller) > On Sep 12, 2016, at 18:41, Ole Begemann wrote: > > > Hmm - interesti

Re: [swift-users] Provide native Decimal data type

2016-09-13 Thread Alex Blewitt via swift-users
Regarding Decimal - it's not yet implemented on Linux, but it's a work in progress. Alex > On 12 Sep 2016, at 18:49, Stephen Canon via swift-users > wrote: > > >> On Sep 12, 2016, at 1:26 PM, Jens Alfke via swift-users >> mailto:swift-users@swift.org>> wrote: >> >>> On Sep 12, 2016, at 10:

Re: [swift-users] Swift and Threads

2016-09-13 Thread Gerriet M. Denkmann via swift-users
> On 13 Sep 2016, at 14:49, Quinn The Eskimo! via swift-users > wrote: > > > On 13 Sep 2016, at 05:03, Gerriet M. Denkmann via swift-users > wrote: > >> Or is the code fundamentally wrong …? > > This one. > > You’re accessing a mutable value (`bitfield`) from multiple threads. Swift > d

Re: [swift-users] Swift and Threads

2016-09-13 Thread Quinn "The Eskimo!" via swift-users
On 13 Sep 2016, at 05:03, Gerriet M. Denkmann via swift-users wrote: > Or is the code fundamentally wrong …? This one. You’re accessing a mutable value (`bitfield`) from multiple threads. Swift does not support that, even in situations like this where you’re sure that the items are preallo