> On Sep 6, 2015, at 3:19 PM, Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> (But merely defining a protocol for each of your subclasses is not an 
> improvement here.)

It does, however, seem to avoid the crash:

class ObjectBase<T> {
        required init() {}
}

protocol MyProtocol {
        func foo()
        func bar()
        func baz()
}

class MyObject: ObjectBase<MyProtocol>, MyProtocol {
        func foo() { print("foo") }
        func bar() { print("bar") }
        func baz() { print("baz") }
        
        required init() {}
}

let obj = MyObject()

compiles and runs without errors.

Charles

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to