Avatar
なんかヤバそうな感じのエラー見つけました。↓をコンパイルすると struct Foo<T> { init(_ f: (@escaping (T) -> ()) -> ()) { } } func foo<T>(_ f: (@escaping (T) -> ()) -> ()) -> Foo<T> { return Foo(f) } func bar() -> Foo<() throws -> Int> { let f: (@escaping (() throws -> Int) -> ()) -> () = { _ in } return foo(f) } ↓のエラーになるんですが、同じ型間で "cannot convert" と言ってます。 error: cannot convert return expression of type 'Foo<() throws -> Int>' to return type 'Foo<() throws -> Int>' もっとシンプルにできるかもしれませんが。 Swift 4.0.3 です。