[swift-users] libswiftCore.dylib was compiled with optimization - stepping may behave oddly;

2016-08-25 Thread David Liu via swift-users
Hi all, can any one here give me some pointers on debugging the standard library? I may be compiling the toolchain incorrectly when i step through the code variables on the stack frame are not available. I think its due to this message when i start the REPL `libswiftCore.dylib was compiled with

Re: [swift-users] Can I do dynamic casting?

2016-08-25 Thread CK TUNG via swift-users
Since Array is a generic struct, the compiler needs know which type to use as the generic parameter. What I think is do something like this below let array:Array = [1,2,3,4,5] let dictionary:[String:Any] = ["numbers":array] if let value = dictionary["numbers"] {   let type = value.dynamicType

Re: [swift-users] How to build a CLI tool which links a Swift framework? (OSX)

2016-08-25 Thread Quinn "The Eskimo!" via swift-users
On 25 Aug 2016, at 11:28, Karl via swift-users wrote: > I’m having a problem getting the framework and CLI tool to work together, > because of the Swift standard libraries … Yep, I know this problem well. What I do is use Xcode to create an app target, remove all the

Re: [swift-users] Implicitly type conversion ?

2016-08-25 Thread Karl via swift-users
> On 19 Aug 2016, at 18:00, Tim Vermeulen via swift-users > wrote: > > Any idea why Swift supports implicit casting to AnyHashable, but not to, say, > AnySequence? > It’s a hack until existential support gets better. Explicitly casting to AnyHashable clutters your

Re: [swift-users] Regression in Xcode8-beta6 Swift?

2016-08-25 Thread David Hart via swift-users
I misunderstood the release notes for Xcode 8 beta 6 I read a few days ago. Here what will interest you: Since ‘id’ now imports as ‘Any’ rather than ‘AnyObject’, you may see errors where you were previously performing dynamic lookup on ‘AnyObject’. For example in: guard let

Re: [swift-users] Regression in Xcode8-beta6 Swift?

2016-08-25 Thread David Hart via swift-users
That proposal also says: Deciding the fate of AnyObject lookup We currently bestow the AnyObject existential type with the special ability to look up any @objc method dynamically, in order to ensure id-based ObjC APIs remain fluent when used in Swift. This is another special, unprincipled,

Re: [swift-users] Regression in Xcode8-beta6 Swift?

2016-08-25 Thread Quinn "The Eskimo!" via swift-users
On 25 Aug 2016, at 08:23, David Hart via swift-users wrote: > You can’t call arbitrary functions on AnyObject anymore. You’re mixing up `Any` and `AnyObject`. You can still call arbitrary methods on `AnyObject`, as Martin demonstrated, but Travis’s error message

Re: [swift-users] Regression in Xcode8-beta6 Swift?

2016-08-25 Thread David Hart via swift-users
You can’t call arbitrary functions on AnyObject anymore. Previously, you could do this: let a: AnyObject = UIView() a.hasPrefix(“test”) // This compiled (because hasPrefix(:_) exists on NSString), but would obviously crash This is not allowed anymore. > On 25 Aug 2016, at 03:33, Travis Griggs