Created
May 14, 2016 05:36
-
-
Save niwatako/a6fff3cc2a83a97a0df43e713202fb1f to your computer and use it in GitHub Desktop.
A<B>を継承したABをExtensionしてプロトコルに準拠させることは出来たっぽい #CodePiece
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol ProtocolA {} | |
class A<T> {} | |
class B {} | |
class C {} | |
class AB: A<B>{} | |
extension AB: ProtocolA{} | |
assert(AB() is ProtocolA) | |
assert(!(A<C>() is ProtocolA)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment