@autoclosure should be a parameter wrapper. It's just a representation of a get accessor (with additional complexity from rethrows that I'm not going to address here). If it were used like this…
@propertyWrapper public struct Get<Value> {
public var wrappedValue: Value { projectedValue() }
public var projectedValue: () -> Value
public init(wrappedValue: @autoclosure @escaping () -> Value) {
projectedValue = wrappedValue
}
public init(projectedValue: @escaping () -> Value) {
self.projectedValue = projectedValue
}
}
func and(_ bool0: Bool, @Get _ bool1: Bool) -> Bool {
bool0 && bool1
}
…then we would have the ability to choose how to utilize the get/value duality, which @autoclosure does not allow:
func expensive() -> Bool { .init() }
_ = and(true, expensive())
_ = and(true, $_: expensive)
However "projected parameter syntax" (or whatever that's called) cannot be used with operators (yet), and init(wrappedValue:) still requires the @autoclosure we have.