Created
May 14, 2016 05:26
-
-
Save niwatako/74154a10b8f2ba8ba41364e4807d3a67 to your computer and use it in GitHub Desktop.
条件を指定した protocol 継承手段はあるのか #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 {} | |
extension A: ProtocolA where T: ClassB {} // extension of type 'A' with constraints cannot have an inheritance clause | |
assert(A<B>() 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