# Explictly capture variables in blocks

**URL:** <https://forums.swift.org/t/explictly-capture-variables-in-blocks/32101>\
**Category:** Pitches\
**Created:** [December 28, 2019, 9:08pm UTC](https://forums.swift.org/t/explictly-capture-variables-in-blocks/32101 "2019-12-28T21:08:16Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![allevato](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/allevato/32/385_2.png) [@allevato](https://forums.swift.org/u/allevato)\
**Post date:** [December 29, 2019, 8:49am UTC](https://forums.swift.org/t/explictly-capture-variables-in-blocks/32101/16 "2019-12-29T08:49:23Z")

</div>

> [@DevAndArtist](#):
>
> I personally wouldn‘t mind a compiler/ide flag to disable implicit captures and require them explicitly or error out, similar to how we can treat warnings as errors already.

This kind of feature is something that the Swift team explicitly [tries to avoid](https://forums.swift.org/t/swiftc-flag-to-set-default-visibility-level/21037/2) as a design philosophy:

> [@brentdax](#):
>
> We try very hard not to create "dialects" of Swift where seemingly valid code can be rejected based on compiler flags or other information that isn't visible in the source file. We unfortunately don't always succeed—resilience and language version both come from compiler flags—but we only do that when one of the language's goals demands it.

---

_[View the full topic](https://forums.swift.org/t/explictly-capture-variables-in-blocks/32101)._
