The following code sample does not compile.
It throws error:
I am not sure if we are only allowed to use a concrete type for associatedtype with protocol constraint. I don't see any reason for this restriction. If we remove the protocol constraint from associatedtype, then it compiles with no error.
Update 2016/12/12: I am using below workaround to tackle above bug. This seems more logical and makes me feel like its not a bug.
The reason this makes more sense to me is that the compiler now has more context on the actual type.