[Pitch] Move Function + "Use After Move" Diagnostic

I floated this idea in the performance manifesto thread, and I still kind of like it. It's clear for newcomers to understand, and if you could assert that multiple values are no longer used in a single statement, it would be a one-line addition to the function (rather than wrapping every assignment in a call to the magic function move()).

I really believe we should be trying to think outside the box here. One of Swift's biggest strengths is that it is approachable. Let's try to devise a syntax which beginners can understand without having to read articles on temporary variables and object lifetimes. They may not immediately understand why it's there, but they should at least be able to understand what it does.

2 Likes