[Idea] Extend "required" to methods other than init()


(Nate Birkholz) #1

My first ever post on this list or any open source project, sorry if I'm
not following procedure accurately, here.

Currently, the "required" keyword on an initializer causes subclasses to
implement their own init methods in place of the so-marked initializer. I
propose extending the use of the required keyword to methods such that when
a new subclass is created, it must create its own unique implementation of
the method, or at ;east explicitly invoke the superclass implementation via
super.methodName()

Requiring child classes to implement the method will improve the
maintainability of codebases over time and is a logical extension of the
current implementation on initialization. This will provide a useful,
nondisruptive, nonbreaking communication tool.

···

--
Nate Birkholz


(Andrey Tarantsov) #2

Hey, and welcome!

We actually talked about it some time before Christmas, with possible names like @must_override. The talks seemed to be going well, but I haven't been following the discussion closely, so cannot provide a summary or status, unfortunately. Please try to find it in the archives.

A.

···

On Jan 15, 2016, at 6:38 AM, Nate Birkholz via swift-evolution <swift-evolution@swift.org> wrote:

My first ever post on this list or any open source project, sorry if I'm not following procedure accurately, here.

Currently, the "required" keyword on an initializer causes subclasses to implement their own init methods in place of the so-marked initializer. I propose extending the use of the required keyword to methods such that when a new subclass is created, it must create its own unique implementation of the method, or at ;east explicitly invoke the superclass implementation via super.methodName()

Requiring child classes to implement the method will improve the maintainability of codebases over time and is a logical extension of the current implementation on initialization. This will provide a useful, nondisruptive, nonbreaking communication tool.

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


(Nate Birkholz) #3

Having trouble locating it, any help, anyone?

···

On Thu, Jan 14, 2016 at 4:58 PM, Andrey Tarantsov <andrey@tarantsov.com> wrote:

Hey, and welcome!

We actually talked about it some time before Christmas, with possible
names like @must_override. The talks seemed to be going well, but I haven't
been following the discussion closely, so cannot provide a summary or
status, unfortunately. Please try to find it in the archives.

A.

On Jan 15, 2016, at 6:38 AM, Nate Birkholz via swift-evolution < > swift-evolution@swift.org> wrote:

My first ever post on this list or any open source project, sorry if I'm
not following procedure accurately, here.

Currently, the "required" keyword on an initializer causes subclasses to
implement their own init methods in place of the so-marked initializer. I
propose extending the use of the required keyword to methods such that when
a new subclass is created, it must create its own unique implementation of
the method, or at ;east explicitly invoke the superclass implementation via
super.methodName()

Requiring child classes to implement the method will improve the
maintainability of codebases over time and is a logical extension of the
current implementation on initialization. This will provide a useful,
nondisruptive, nonbreaking communication tool.

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

--
Nate Birkholz


(James Campbell) #4

There is some link on the swift site of all the archives

···

Sent from my iPhone

On 15 Jan 2016, at 01:36, Nate Birkholz via swift-evolution <swift-evolution@swift.org> wrote:

Having trouble locating it, any help, anyone?

On Thu, Jan 14, 2016 at 4:58 PM, Andrey Tarantsov <andrey@tarantsov.com> wrote:
Hey, and welcome!

We actually talked about it some time before Christmas, with possible names like @must_override. The talks seemed to be going well, but I haven't been following the discussion closely, so cannot provide a summary or status, unfortunately. Please try to find it in the archives.

A.

On Jan 15, 2016, at 6:38 AM, Nate Birkholz via swift-evolution <swift-evolution@swift.org> wrote:

My first ever post on this list or any open source project, sorry if I'm not following procedure accurately, here.

Currently, the "required" keyword on an initializer causes subclasses to implement their own init methods in place of the so-marked initializer. I propose extending the use of the required keyword to methods such that when a new subclass is created, it must create its own unique implementation of the method, or at ;east explicitly invoke the superclass implementation via super.methodName()

Requiring child classes to implement the method will improve the maintainability of codebases over time and is a logical extension of the current implementation on initialization. This will provide a useful, nondisruptive, nonbreaking communication tool.

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

--
Nate Birkholz

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