[swift-users] A confusing protocol extension behaviour/bug

2018-01-01 Thread Marc Palmer via swift-users
Hi, I hope everybody had a great New Year celebration. I was tracking down a weird bug in my Swift code today. A property defined in a class in order to conform to a protocol was not being seen. A protocol extension provided a default value of `nil` for this property, so I knew where it was co

Re: [swift-users] A confusing protocol extension behaviour/bug

2018-01-02 Thread Marc Palmer via swift-users
> On 1 Jan 2018, at 20:40, Toni Suter wrote: > > Hi Marc, > > There are several subtleties here, but I think the compiler is actually doing > the right thing. > Hi Toni, Thanks for your detailed response. [..] > The second class defines a static property that looks like it is 'overriding'

Re: [swift-users] A confusing protocol extension behaviour/bug

2018-01-02 Thread Marc Palmer via swift-users
> On 2 Jan 2018, at 09:12, Toni Suter wrote: > > > You can only 'overload' properties that are inherited from a protocol > extension. > > protocol P {} > extension P { > static var x: Int { return 2 } > } > struct S: P { > static var x = "" > } > > I am not exactly sure why this is

Re: [swift-users] A confusing protocol extension behaviour/bug

2018-01-02 Thread Marc Palmer via swift-users
> On 2 Jan 2018, at 13:06, Toni Suter wrote: > > Yes, I think I agree with you. Maybe we are missing something, but I don't > see a reason why declaring a property with the same name and a different type > should be allowed in the 1. scenario. > > So maybe you should file a bug in JIRA, after a

[swift-users] Workarounds for SR-6039?

2018-01-08 Thread Marc Palmer via swift-users
Hi, It’s hard to be 100% certain because of bugs.swift.org being down currently, but I believe I have hit this bug: https://bugs.swift.org/browse/SR-6039 "A `protocol A: class` is not any `AnyObject`” This is marked as a duplicate of a presumably very old issue judging by its low number: htt