The above code should compile: The requirement on generic `T` is that is that it extends from `AnyObject`. Since protocol `Beta` also extends from `AnyObject` it holds that any class `Foo` that implements protocol `Beta` will also extend from `AnyObject`
Code does not compile. Error message is error: "'Alpha' requires that 'Beta' be a class type"
Note: `class` and `AnyObject` are type-aliased to the same thing, so changing to `Beta: class` produces the same error
This is unfortunately correct behavior, because a protocol value isn't just a reference to the object; it also tracks information about how the type conforms to the protocol. See SR-55 and its dups for more discussion.