the.bay.news

[Pitch] Introduce a way to annotate functions that are called at most once

Swift Forums
[Pitch] Introduce a way to annotate functions that are called at most once
Hello Swift community! This pitch introduces a @called(once) attribute to model at-most once execution of a function. Making function execution behavior visible to the compiler has two advantages. First, it makes it possible to diagnose incorrect usage of such functions. But, it also allows the compiler to understand how closure captures could affect variable lifetimes. This can improve compatibility with non-Copyable types. A complete proposal could be found here - Proposal: `@called(once)` a...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.