Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-18 Thread Tony Parker via swift-users
We renamed some of these methods for Swift 3 in an attempt to remove some of the confusion surrounding which of these did what - they were really named for C types and not Swift ones. encodeInt:forKey: and decodeInt:forKey: are the two missing ones, since they were easily confused with the Swif

Re: [swift-users] Can't initialise using a UTF8 string from within 'withUnsafeBufferPointer' expression

2016-07-18 Thread Brent Royal-Gordon via swift-users
> On Jul 18, 2016, at 11:44 AM, Karl via swift-users > wrote: > > Also, as interesting as that may be, I’m also curious what to do in the > general case for types without magic compiler optimisations. Wait for Swift 4, apparently: https://github.com/apple/swift-evolution/blob/master/proposals

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-18 Thread Brent Royal-Gordon via swift-users
> Hi Tony - when I add that attribute, I get an error at compile-time: > Objective-C method has a different selector from the method it overrides > ('encodeInt:forKey:' vs. 'encodeInteger:forKey:') > > If I update to encodeInteger:forKey as the fix describes, it compiles, but > I'm getting the s

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-18 Thread John Spurlock via swift-users
Hi Tony - when I add that attribute, I get an error at compile-time: Objective-C method has a different selector from the method it overrides ('encodeInt:forKey:' vs. 'encodeInteger:forKey:') If I update to encodeInteger:forKey as the fix describes, it compiles, but I'm getting the same original p

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-18 Thread Tony Parker via swift-users
Probably, but there could be a compiler bug or importer bug lurking here. - Tony > On Jul 18, 2016, at 5:29 PM, Jacob Bandes-Storch wrote: > > Shouldn't that be implicit, since the function is `override`? > > On Mon, Jul 18, 2016 at 5:25 PM, Tony Parker via swift-users > mailto:swift-users@sw

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-18 Thread Jacob Bandes-Storch via swift-users
Shouldn't that be implicit, since the function is `override`? On Mon, Jul 18, 2016 at 5:25 PM, Tony Parker via swift-users < swift-users@swift.org> wrote: > Hi John, > > Can you try this? > > @objc(encodeInt:forKey:) > override func encode(_ intv: Int, forKey key: String) { > print("\

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-18 Thread Tony Parker via swift-users
Hi John, Can you try this? @objc(encodeInt:forKey:) override func encode(_ intv: Int, forKey key: String) { print("\(key) \(intv)") // never called } - Tony > On Jul 18, 2016, at 12:11 AM, John Spurlock via swift-users > wrote: > > Minimal repro case below. I'm creating a custom

Re: [swift-users] NSData and UnsafePointer

2016-07-18 Thread J.E. Schotsman via swift-users
> On 16 Jul 2016, at 22:16, Andrew Trick wrote: > > I don’t know what the recommended idiom is or if the syntax has changed from > Swift 2 to 3, but I would do something like this: > > withExtendedLifetime(data) { > let dataStart = UnsafePointer(data.bytes) > myProcessdata1(dataStart,data.le

Re: [swift-users] Can't initialise using a UTF8 string from within 'withUnsafeBufferPointer' expression

2016-07-18 Thread Karl via swift-users
> On 18 Jul 2016, at 14:51, Martin R wrote: > > This is not an answer to your question, but note that you can pass a Swift > String to functions expecting an UnsafePointer (C String) parameter, > and the compiler will generate a temporary NUL-terminated UTF-8 > representation for you: > > l

Re: [swift-users] Building Swift 3 under ArchLinux

2016-07-18 Thread Farhan Ahmed via swift-users
Thank Lukas. I applied that patch and it did not work for me, at for the incremental build. I will do a complete clean kick off the build process with this patch to see if that resolves the issue. Best, Farhan > On Jul 17, 2016, at 10:48 PM, Lukas Stabe wrote: > > I ran into the same error a

Re: [swift-users] Can't initialise using a UTF8 string from within 'withUnsafeBufferPointer' expression

2016-07-18 Thread Martin R via swift-users
This is not an answer to your question, but note that you can pass a Swift String to functions expecting an UnsafePointer (C String) parameter, and the compiler will generate a temporary NUL-terminated UTF-8 representation for you: let io = DispatchIO(type: .stream, path: "/path/to/file", ...

[swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-18 Thread John Spurlock via swift-users
Minimal repro case below. I'm creating a custom NSCoder, but the "encodeInt:forKey" call is not dispatched properly to my overridden method when encoding an NSCalendar instance. What am I missing here? Without source code for any of this, I'm at a dead end. Thanks, - john =

Re: [swift-users] Building Swift 3 under ArchLinux

2016-07-18 Thread Michael Gottesman via swift-users
> On Jul 17, 2016, at 12:58 PM, Farhan Ahmed via swift-users > wrote: > > Thanks Kyle for the help and link to the swiftenv. I didn’t know it was > available, and was wondering if there was one available… saves me the trouble > of writing one ;) > > I have all dependencies installed. The err