[swift-users] Is there an equivalence method on `NSArray`'s `func objects(at indexes: IndexSet) -> [Any]` in Array?

2016-10-06 Thread Zhao Xin via swift-users
I managed to do that by using `map` as I didn't find the equivalence. files.forEach { var indices = IndexSet() for index in 0 ..< subtitleFiles.count { if $0.sn == subtitleFiles[index].sn { indices.insert(index) } } let subtitles =

Re: [swift-users] Swift REPL broken after updating to Sierra, is it just me?

2016-10-06 Thread Jens Persson via swift-users
Thanks! I moved the following to a temporary location: ~ ├── .lldb │ ├── lldb-history │ ├── lldb-repl-history │ └── lldb-swift-history └── .lldb-swift-history And that made the REPL work again. I will zip and attach those files to 28657007. /Jens On Thu, Oct 6, 2016 at 9:52 PM, Jim Ingham

Re: [swift-users] Overload Resolution

2016-10-06 Thread Toni Suter via swift-users
Hi Mark, Thanks for pointing me into the right direction! Best regards, Toni > Am 06.10.2016 um 16:31 schrieb Mark Lacey : > > >> On Oct 6, 2016, at 4:53 AM, Toni Suter via swift-users >> > wrote: >> >> Hi, >> >>

Re: [swift-users] Swift REPL broken after updating to Sierra, is it just me?

2016-10-06 Thread Jim Ingham via swift-users
There is a known bug in libedit's history file reader that can cause this crash. libedit is a system component that lldb uses to do command-line editing and the like. Try moving ~/.lldb-history to some other name, and then rerunning the REPL. If that works, can you attach that history file

Re: [swift-users] Swift REPL broken after updating to Sierra, is it just me?

2016-10-06 Thread Jens Persson via swift-users
Here is with Xcode.app: › sudo xcode-select -s /Applications/Xcode.app Password: › › swift -v Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38) Target: x86_64-apple-macosx10.9 /Applications/Xcode.app/Contents/Developer/usr/bin/lldb "--repl=-target x86_64-apple-macosx10.9

Re: [swift-users] Swift REPL broken after updating to Sierra, is it just me?

2016-10-06 Thread Jens Persson via swift-users
I was trying both Xcode and Xcode-beta, I just happened to copy paste while Xcode-beta was selected ... Anyway, both of them crash like that. /Jens On Thu, Oct 6, 2016 at 7:22 PM, Kate Stone wrote: > If you’ve specified “sudo xcode-select -s /Applications/Xcode.app” then >

[swift-users] DispatchQueue extension

2016-10-06 Thread Nick Brook via swift-users
I have an extension on DispatchQueue and I have Objective-C code which uses my swift code, so the DispatchQueue extension is exported to the Swift objective-c header as @interface OS_dispatch_queue However, Xcode 8.0 and 8.2b2 both error ‘Cannot find interface declaration for

Re: [swift-users] [swift-evolution] [Question] Types of functions

2016-10-06 Thread Adrian Zubarev via swift-users
Maybe :D No actually I had to test an iOS app feature depending on that date but forget to reset the system date and time. --  Adrian Zubarev Sent with Airmail Am 6. Oktober 2016 um 20:38:53, Vladimir.S (sva...@gmail.com) schrieb: (Adrian, are you from the future? ;-) 

Re: [swift-users] [swift-evolution] [Question] Types of functions

2016-10-06 Thread Vladimir.S via swift-users
On 12.11.2016 11:38, Adrian Zubarev via swift-users wrote: (Adrian, are you from the future? ;-) We should move this thread to swift-users. Here is something that I just tried: |func foo(_: Int, _: Int) {} func boo(_: (Int, Int)) {} type(of: foo) == type(of: boo) //=> true ; (((Int, Int)) ->

Re: [swift-users] Segfault: 11 only when running tests (XCode 8, Swift 2.3)

2016-10-06 Thread Jordan Rose via swift-users
Can you double-check that all of your Utilities headers are Public or Private headers (not Project)? You can check this under the Build Phases tab for the framework target. If that doesn't do it, we can probably help more with a bug report, if you're willing to share your project. Jordan >

Re: [swift-users] Swift REPL broken after updating to Sierra, is it just me?

2016-10-06 Thread Kate Stone via swift-users
If you’ve specified “sudo xcode-select -s /Applications/Xcode.app” then it’s surprising that the REPL session is attempting to use the LLDB and SDK from /Applications/Xcode-beta.app. Can you double-check what “xcode-select -p” reports? I can’t say I’ve seen a segmentation fault on REPL

Re: [swift-users] Overload Resolution

2016-10-06 Thread Mark Lacey via swift-users
> On Oct 6, 2016, at 4:53 AM, Toni Suter via swift-users > wrote: > > Hi, > > Does someone know a good explanation / summary of Swift's overload resolution > rules? > After reading https://github.com/apple/swift/blob/master/docs/TypeChecker.rst >

[swift-users] Segfault: 11 only when running tests (XCode 8, Swift 2.3)

2016-10-06 Thread Thomas Abend via swift-users
Since moving a mixed Swift and Objective-c project to XCode 8 with Swift 2.3, I have been getting a "Command failed due to signal: Segmentation fault: 11" error every time I run my tests after making a change in any of the test files. When I click on the error for more information I see: :1:9:

Re: [swift-users] [swift-evolution] [Question] Types of functions

2016-10-06 Thread Adrian Zubarev via swift-users
We should move this thread to swift-users. Here is something that I just tried: func foo(_: Int, _: Int) {} func boo(_: (Int, Int)) {} type(of: foo) == type(of: boo) //=> true ; (((Int, Int)) -> ()).Type let tuple = (0, 42) foo(tuple) // Tuple splat was removed => Error boo(tuple) // Expected