# SE-0293: Extend Property Wrappers to Function and Closure Parameters

**URL:** <https://forums.swift.org/t/se-0293-extend-property-wrappers-to-function-and-closure-parameters/42400>\
**Category:** Proposal Reviews\
**Created:** [December 1, 2020, 6:27pm UTC](https://forums.swift.org/t/se-0293-extend-property-wrappers-to-function-and-closure-parameters/42400 "2020-12-01T18:27:21Z")\
**Posts on this page:** 1\
**Showing post:** 34

<div class="post-metadata">

**Author:** ![hborla](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/hborla/32/27563_2.png) [@hborla](https://forums.swift.org/u/hborla)\
**Post date:** [December 4, 2020, 3:44pm UTC](https://forums.swift.org/t/se-0293-extend-property-wrappers-to-function-and-closure-parameters/42400/34 "2020-12-04T15:44:05Z")

</div>

> [@Lantua](#):
>
> @hborla Would it be possible to use a pre-transformed ABI, and generate post-transformed boilerplate when being captured by a variable? So we'd have `(Wrapper)->()` ABI, and can still treat it as `(Int)->()` on the API level.

I do think it's possible to transform a closure or a function reference that has a property wrapper parameter so that it can be called with the wrapped type. @Jumhyn suggested such a transformation in the pitch thread:

> [@Pitch #2: Extend Property Wrappers to Function and Closure Parameters](https://forums.swift.org/t/pitch-2-extend-property-wrappers-to-function-and-closure-parameters/40959/62):
>
> Do you have thoughts on the tradeoffs of implementing a transformation for function references like I wrote above, where the problematic line in this example would become:
> 
> ```swift
> let bar = { (arg1: Int, arg2: Int) in foo(arg1: Box(wrappedValue: arg1), arg2: Box(wrappedValue: arg2)) }
> 
> ```
> 
> ?

However, the motivating use case for closures as laid out in the proposal is opting into property wrapper syntax for closures that accept property wrapper types.

EDIT: Remember that this is a general problem with parameter declaration attributes and other information like default arguments. I think it's worth solving the problem holistically, rather than specifically for property wrapper parameters.

---

_[View the full topic](https://forums.swift.org/t/se-0293-extend-property-wrappers-to-function-and-closure-parameters/42400)._
