Avatar
Xcode10.1だとまだ壊れてますね
11:35 AM
import Foundation protocol Animal { associatedtype Food } protocol Carnivore: class { func bark() } class Lion: Carnivore, Animal { typealias Food = Carnivore func bark() { print("gawgaw") } } func something<T: Animal>(_ type: T.Type) { print(T.self as? T.Food) }