func f() -> P { if Bool.random() { return 17 } else { return "hello, existential" } }
こういうのはできないってことらしいfunc f() -> P { /* ... */ } func g() -> opaque P { /* ... */ } let fArray = [f(), f(), f()] // contains a mix of String and Int at run-time let gArray = [g(), g(), g()] // homogeneous array of g()'s opaque result type
let vf1 = f1() // type of vf1 is the opaque result type of f1()