(re-added swift-evolution) I would think so. It's an abbreviation of a given init function, so you would call other self.init() or super.init() functions normally. Saves on complication.
Alternatively, perhaps you could do this: init(self.foo: String, super.bar: String, super.baz: Int) as an abbreviation of init(foo: String, bar: String, baz: Int) { self.foo = foo super.init(bar: bar, baz: baz) } I think this would probably require allowing parameters to stay re-orderable, though (in case super's init is "init(baz: Int, bar: String)" ). On Thu, Apr 14, 2016 at 4:29 PM, Vladimir.S wrote: > +1. This will make our life easier, it is clear and explicit about the > result. > > I assume that there must be a constrain : you can use in init(...) only > props introduced in the same class, not in parent class. > > > On 14.04.2016 17:32, Ross O'Brien via swift-evolution wrote: > >> init(self.foo: String, self.bar: String, self.baz: Int) >> >> { >> >> barCount = bar.characters.count >> >> } >> >> } >> >> >> Less boilerplate, more focus on the properties which need to be generated. >> >> Thoughts? >> >
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution