【发布时间】:2021-10-20 13:35:44
【问题描述】:
我有一些泛型函数,我需要获得具有特定泛型类型的泛型函数的链接。
// my generic function
func messageResult<M: SwiftProtobuf.Message>(_ dto: M?) {
result(try? dto?.serializedData())
}
// then i try get link to the function with a specific generic type
// but i throw error
let dtoResult = messageResult<Dto.OpenResult>
错误信息:'>' is not a postfix unary operator
ide 突出显示:let dtoResult = messageResult<Dto.OpenResult????>
怎样才能写得好?
【问题讨论】: