Re: [swift-users] Improving compilation times?

2017-03-23 Thread Rien via swift-users
Thanks for that link, used it to track down the worst compile time offender: This piece of code: public func logAddrInfoIPAddresses(_ infoPtr: UnsafeMutablePointer) -> String { let addrInfoNil: UnsafeMutablePointer? = nil var count: Int = 0 var info: UnsafeMutablePointer = infoP

Re: [swift-users] Improving compilation times?

2017-03-23 Thread David Hart via swift-users
Yes, it's best to avoid concatenating strings with +. Not only for performance reasons, but it's also less readable than string interpolation: str += "No: \(count), HostIp: \(clientIp ?? "?") at port: \(service ?? "?")\n" > On 23 Mar 2017, at 08:11, Rien via swift-users wrote: > > Thanks for t

Re: [swift-users] Improving compilation times?

2017-03-23 Thread Rien via swift-users
> On 23 Mar 2017, at 08:27, David Hart wrote: > > Yes, it's best to avoid concatenating strings with +. Not only for > performance reasons, but it's also less readable than string interpolation: > > str += "No: \(count), HostIp: \(clientIp ?? "?") at port: \(service ?? "?")\n” Concatenation m

Re: [swift-users] Improving compilation times?

2017-03-23 Thread Mark Lacey via swift-users
> On Mar 23, 2017, at 12:32 AM, Rien via swift-users > wrote: > > >> On 23 Mar 2017, at 08:27, David Hart wrote: >> >> Yes, it's best to avoid concatenating strings with +. Not only for >> performance reasons, but it's also less readable than string interpolation: >> >> str += "No: \(count

[swift-users] Generic and Nested Types

2017-03-23 Thread Седых Александр via swift-users
Hello. Please explain me, why we can't make Nested Types in Generic Types? -- Седых Александр___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

Re: [swift-users] Improving compilation times?

2017-03-23 Thread piotr gorzelany via swift-users
Hi Mark, Thanks for the answer, its great to know that somebody is working on it! I tried to add the -Xfrontend -debug-time-expression-type-checking in Xcode in the Other Swift Flags section but that gives me an error when compiling :0: error: unknown argument: '-debug-time-expression-type-check

Re: [swift-users] Generic and Nested Types

2017-03-23 Thread Zhao Xin via swift-users
Which you? Zhaoxin On Thu, Mar 23, 2017 at 4:55 PM, Седых Александр via swift-users < swift-users@swift.org> wrote: > Hello. Please explain me, why we can't make Nested Types in Generic Types? > > > > -- > Седых Александр > > ___ > swift-users mailing

Re: [swift-users] Asynchronous error recovering with RecoverableError

2017-03-23 Thread Elia Cereda via swift-users
I'd like to bump this issue, since it has been some time and it hasn't been addressed. Thanks, Elia Cereda > Il giorno 03 mar 2017, alle ore 21:33, Elia Cereda ha > scritto: > > I’m wondering why the resultHandler block on > RecoverableError.attemptRecovery(optionIndex, resultHandler:) is no

Re: [swift-users] Improving compilation times?

2017-03-23 Thread Rien via swift-users
Just tried it, did not work on the command line either, though with a simple message “build commands failed” The following command line however does work: xcodebuild -scheme Swiftfire clean build OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies" | grep .[0-9]ms | grep -v ^0.[0-9]ms | s

Re: [swift-users] Improving compilation times?

2017-03-23 Thread Rien via swift-users
> On 23 Mar 2017, at 10:27, Rien wrote: > > Just tried it, did not work on the command line either, though with a simple > message “build commands failed” > > The following command line however does work: > > xcodebuild -scheme Swiftfire clean build OTHER_SWIFT_FLAGS="-Xfrontend > -debug-tim

Re: [swift-users] Improving compilation times?

2017-03-23 Thread piotr gorzelany via swift-users
Rien, You can also add the flag -Xfrontend -warn-long-function-bodies=100 directly to Other Swift Flags in Xcode. Xcode will then generate warnings for each function that compiles more than the specified amount of time (milliseconds) you supplied in the parameter (100 in this case). Regards, Piot

[swift-users] type casting for Dictionaries keys

2017-03-23 Thread Седых Александр via swift-users
Hello again :) I have another question. Why Type casting for Keys of Dictionaries don't work enum  Key {      case  one }   let  dict: [ AnyHashable :  Any ] = [ Key . one  :  "Hello" ] let  unwrap: [ Key :  Any ] =  dict  as ! [ Key  :  Any ]  // error -- Седых Александр_

Re: [swift-users] Generic and Nested Types

2017-03-23 Thread Quinn "The Eskimo!" via swift-users
On 23 Mar 2017, at 08:55, Седых Александр via swift-users wrote: > Please explain me, why we can't make Nested Types in Generic Types? I believe you can in the latest Xcode 8.3 beta. This is courtesy of SR-1446. Share and Enjoy -- Quinn "The Eskimo!"

Re: [swift-users] type casting for Dictionaries keys

2017-03-23 Thread Adrian Zubarev via swift-users
It's because AnyHashable is not an existential like Any but a value type (I believe it was a struct) which erases the type restriction from your Hashable type. Simply look up AnyHashable. -- Adrian Zubarev Sent with Airmail Am 23. März 2017 um 12:07:16, Седых Александр via swift-users (swi

Re: [swift-users] Improving compilation times?

2017-03-23 Thread Mark Lacey via swift-users
> On Mar 23, 2017, at 1:58 AM, piotr gorzelany > wrote: > > Hi Mark, > > Thanks for the answer, its great to know that somebody is working on it! > > I tried to add the -Xfrontend -debug-time-expression-type-checking in Xcode > in the Other Swift Flags section but that gives me an error when

Re: [swift-users] Improving compilation times?

2017-03-23 Thread piotr gorzelany via swift-users
I tried using it with the latest Xcode release (version 8.2). W dniu czw., 23.03.2017 o 17:57 Mark Lacey napisał(a): > On Mar 23, 2017, at 1:58 AM, piotr gorzelany > wrote: > > Hi Mark, > > Thanks for the answer, its great to know that somebody is working on it! > > I tried to add the -Xfrontend

Re: [swift-users] Improving compilation times?

2017-03-23 Thread Mark Lacey via swift-users
> On Mar 23, 2017, at 10:02 AM, piotr gorzelany > wrote: > > I tried using it with the latest Xcode release (version 8.2). That was released prior to the addition of the new option. Recent snapshot builds from https://swift.org/download/#snapshots as w