blob: 55f775c53b49f70414e39da2b7692240fc99de6f [file] [log] [blame]
// RUN: %target-swift-frontend %s -emit-ir -o -
public protocol NumProt: Prot {
func value() -> Double
}
extension Float: NumProt {
public func value() -> Double {
return Double(self)
}
}
public protocol Prot: CustomStringConvertible {
func getOp() -> Op
}
extension Prot {
public func getOp() -> Op {
return Op("\(self) ")
}
}
public protocol CompProt: Prot {}
open class Op: CompProt {
fileprivate var valueText = ""
open var description: String {
return "42"
}
open func getOp() -> Op {
return self
}
public init(_ value: Double) {
self.valueText = "\(value)"
}
public init(_ operationString: String) {
self.valueText = operationString
}
}