2019-11-30a few seconds read (About 62 words)How to use method from protocol extension in SwiftIssue #524 1234567891011121314151617181920/// Any task that uses command linepublic protocol UsesCommandLine: AnyObject { var program: String { get } var arguments: Set<String> { get set }}public extension UsesCommandLine { func run() throws { let command = "\(program) \(arguments.joined(separator: " "))" Log.command(command) _ = try Process().run(command: command) }}class Build: UsesCommandLine { public func run() throws { arguments.insert("build") try (self as UsesCommandLine).run() }}#swift