[swift-evolution] [Proposal] Sealed classes by default

Brent Royal-Gordon brent at architechies.com
Fri Jul 1 01:54:49 CDT 2016


> If we're going to go along those lines, we should just use public(subclassable) and public(overridable).  We can fall back on those if necessary; I would just like to continue looking for better alternatives.

I would prefer to have a *single* keyword which meant both public and overridable. That would minimize the impact of this feature—instead of writing:

	public class MyViewController: UIViewController {
		public func displayMe(_ me: person) { … }
	}

You'd write (strawman keyword):

	openseason class MyViewController: UIViewController {
		openseason func displayMe(_ me: person) { … }
	}

And then `MyViewController` could be subclassed, and `displayMe` overridden.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list