Re: [swift-users] Using ... as a concrete type conforming to protocol ... is not supported

2016-03-25 Thread Hooman Mehr via swift-users
Oops! that is buggy. I should check syntax before posting… Here is the corrected version: public struct AnyKey : Hashable { public let hashValue: Int public let key: Any public let equals: (Any, AnyKey) -> Bool init(_ key: T) { self.hashValue = key.hashV

Re: [swift-users] Using ... as a concrete type conforming to protocol ... is not supported

2016-03-25 Thread Hooman Mehr via swift-users
You can also get a heterogenous dictionary, but it needs a type erasing helper box. With the following declarations: public func ==(lhs: T, rhs: Any) -> Bool { if let rhs = rhs as? T { return lhs == rhs } else { return false } } public struct AnyKey : Hashable { public let hash

Re: [swift-users] Using ... as a concrete type conforming to protocol ... is not supported

2016-03-25 Thread Hooman Mehr via swift-users
> On Mar 25, 2016, at 2:51 PM, Jason Sadler via swift-users > wrote: > > (My particular use case can be seen here: > https://gist.github.com/sadlerjw/2cc16b4375b02fe7f400 > … and the best > information I’ve been able to find on this so

Re: [swift-users] Swift.org RSS Feed appears broken

2016-03-25 Thread Neil via swift-users
Ted, Working like a champ. Thanks, Neil > On Mar 25, 2016, at 3:03 PM, Ted Kremenek wrote: > > Can you try now? > > On Mar 25, 2016, at 5:01 AM, Neil > wrote: > >> Thanks, Ted, >> >> Unfortunately, it still does not load in Vienna (http://www.vienna-rss.org

Re: [swift-users] Using ... as a concrete type conforming to protocol ... is not supported

2016-03-25 Thread Jason Sadler via swift-users
I think Simon was referring to two separate problems in his post - first: > Using ‘KeyType' as a concrete type conforming to protocol 'Hashable' is not > supported And second: > type 'Key' constrained to non-protocol type ‘String’ The first error (which is of particular interest to me) you can

Re: [swift-users] Swift.org RSS Feed appears broken

2016-03-25 Thread Kevin Lundberg via swift-users
I saw the latest 2.2 announcement post in my reader yesterday, so it does appear to be fixed. Kevin Lundberg ke...@klundberg.com > On Mar 24, 2016, at 1:18 PM, Ted Kremenek via swift-users > wrote: > > Hi Neil, > > Aside from the encoding issue (which we are looking into), this should now

Re: [swift-users] Strange type error

2016-03-25 Thread zhigang via swift-users
It might have something to do with `setSubscriptee` with seems from the implementation is a `mutating` operation. If you comment it out, or just give it a empty callback, it will pass compile. Kyle On Tue, Mar 22, 2016 at 6:23 AM Howard Lovatt via swift-users < swift-users@swift.org> wrote:

Re: [swift-users] Strange type error

2016-03-25 Thread zhigang via swift-users
You can not mutate a array itself in a `var asScriptable` you might be able to accomplish such with a function. struct AllSubscriptable { let setSubscriptee: (index: Index, element: E) -> Void } extension Array { mutating func asScriptable() -> AllSubscriptable { func sub(key:In

Re: [swift-users] Source code " : " guidelines

2016-03-25 Thread Dave Abrahams via swift-users
on Sat Dec 05 2015, Paul Schifferer wrote: > My personal preference is to put a space on both sides of the colon when it’s > used for declaration or extension: > > class SomeClass : SomeProtocol { >   var name : String > } > > and a space only after it’s used for providing a value (as in a func