SE-0244: Opaque Result Types (reopened)

Here's the diff for those interested.


My opinion is mostly unchanged from before, except I can now appreciate the "some" name better now that we have "any" as a counterpart in sight for the future.

The most worrisome aspect for me remains the inability to refer to the opaque type by name, which makes composability difficult. I proposed earlier that #returnType(of: someFunction) could be used for that, but the UI of Generics document made me think of a more ergonomic syntax:

struct DrawingBoard {
    var shape: some Shape from someFunction
    init() { shape = someFunction() }
}

Perhaps it's too much to expect this to be part of this proposal, but I believe this is quite important to have when working with opaque types.

Overall I'm positive about this proposal.

2 Likes