func apply<T, U>(fn: (T...) -> U, args: [T]) -> U { typealias Fn = ([T]) -> U return unsafeBitCast(fn, to: Fn.self)(args) } let dict = apply(fn: Dictionary.init, args: ["a": 1, "b": 2, "c": 3].filter { $0.value % 2 == 0 }) print(dict) // ["b": 2]
いけますね…