[Pitch] Non-Escapable Types and Lifetime Dependency

EDIT: The answer is right above me :upside_down_face:

Would it be possible to use the internal name of the parameters instead of their external label? To borrow an example from the proposal, but adding a missing internal parameter name:

func mutatingBufferReference(to array: inout Array) -> mutate(to) MutatingBufferReference<Element>

I think this would read much more naturally as:

func mutatingBufferReference(to array: inout Array) -> mutate(array) MutatingBufferReference<Element>

Now, my initial thought was that the external labels were chosen because they define the API while the internal names don't. However, internal names are still surfaced publicly; they're visible in documentation and parameters in doc comments are labeled with their internal name, not their external label. So there's precedent for defining things based on them.

This would also solve the awkwardness around repeated labels or unlabeled arguments: internal names must be unique and must be present, even when labels aren't. I think this would let you drop the integer-based scheme.

6 Likes