[swift-evolution] Properties on Default Protocol Implementations

Chris Lattner clattner at apple.com
Mon Jan 11 19:25:01 CST 2016


> On Jan 11, 2016, at 3:46 PM, Trent Nadeau <tanadeau at gmail.com> wrote:
> 
> Syntactically, would PwS be special like class-only protocols are now or would it be automatic by having stored property declarations within the protocol?

Up for debate.  An automatic approach brings hesitation to me, because I don’t want it to be the difference between:

protocol P {
  var x : Int { get }
}

and:

protocol P {
  var x : Int 
}

Did I want a PwS there, or did I just forget {get/set}?

Marking the protocol with an attribute or declmodifier would solve that.

-Chris


More information about the swift-evolution mailing list