Files
swift-mirror/test/ModuleInterface/Inputs/ConformancesUser.swift
Harlan Haskins d3b8ce7ae2 [test] Update ParseableInterface to ModuleInterface
Also remove uses of -emit-parseable-module-interface from tests
2019-09-13 14:55:48 -07:00

30 lines
609 B
Swift

import Conformances
func testGeneric<T: MyProto>(_: T.Type) -> Int {
var impl = T.init()
impl.method()
impl.prop = 0
return impl[0]
}
public func testFull() -> Int {
return testGeneric(FullStructImpl.self)
}
public func testOpaque() -> Int {
return testGeneric(OpaqueStructImpl.self)
}
func testOptionalGeneric<T: OptionalReqs>(_ obj: T) -> Bool {
return obj.method?() != nil
}
public func testOptionalPresent(_ obj: OptionalReqsPresent) -> Bool {
return testOptionalGeneric(obj)
}
public func testOptionalAbsent(_ obj: OptionalReqsAbsent) -> Bool {
return testOptionalGeneric(obj)
}