[Pitch] Memberwise initialisers adopt the same access modifiers as the struct


(Ian Keen) #1

Not much to this one… I think the memberwise `init` should follow the same level of access as the struct. It appears to default to `internal` regardless of the struct access modifiers

Thoughts?


(Matthew Johnson) #2

Not much to this one… I think the memberwise `init` should follow the same level of access as the struct. It appears to default to `internal` regardless of the struct access modifiers

Thoughts?

There was an extensive discussion and review of a proposal I put forward early this year for improving memberwise initialization. This topic has been deferred until after Swift 3 wraps up. We’ll be revisiting it in the coming months.

···

On Jul 20, 2016, at 8:15 PM, Ian Keen via swift-evolution <swift-evolution@swift.org> wrote:

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Ian Keen) #3

I did see that one, however it appeared that proposal didn’t could on the access of the initialiser itself at all? just how it interacts with different properties access levels. It was kinda gargantuan, I’m proposing a single behavioural change for now, rather than introducing a ton of new features.

I would almost consider this a bug.

···

> On Jul 20, 2016, at 8:15 PM, Ian Keen via swift-evolution<swift-evolution@swift.org>wrote:
>
> Not much to this one… I think the memberwise `init` should follow the same level of access as the struct. It appears to default to `internal` regardless of the struct access modifiers
>
> Thoughts?
There was an extensive discussion and review of a proposal I put forward early this year for improving memberwise initialization. This topic has been deferred until after Swift 3 wraps up. We’ll be revisiting it in the coming months.

>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution@swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution


(Matthew Johnson) #4

I did see that one, however it appeared that proposal didn’t could on the access of the initialiser itself at all? just how it interacts with different properties access levels. It was kinda gargantuan, I’m proposing a single behavioural change for now, rather than introducing a ton of new features.

I would almost consider this a bug.

This is an additive change so it is out of scope for Swift 3 no matter how small. There are already plans to revisit the memberwise initialization discussion after Swift 3 is out. I encourage you to join that discussion when it gets going.

···

Sent from my iPad

On Jul 21, 2016, at 11:26 AM, Ian Keen <iankeen82@gmail.com> wrote:

On Jul 20, 2016, at 8:15 PM, Ian Keen via swift-evolution<swift-evolution@swift.org>wrote:

Not much to this one… I think the memberwise `init` should follow the same level of access as the struct. It appears to default to `internal` regardless of the struct access modifiers

Thoughts?

There was an extensive discussion and review of a proposal I put forward early this year for improving memberwise initialization. This topic has been deferred until after Swift 3 wraps up. We’ll be revisiting it in the coming months.

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution