This would be neat! I agree that this behavior more closely captures the 'traffics-in-wrapped-type' APIs that are not meant to be enabled by this feature.
Given our discussion, though, I'm not sure that I really consider this a feature. If argument wrappers are only intended to be used when you would normally pass the storage type, why is it a 'win' to make the call and declaration sites look as though they are accepting the wrapped type? Passing the wrapped type is not really "how to call the function" if the function is actually meant to traffic in the storage typeâit's just a sugar to make initializing the storage type more convenient.
The more I think about this, the more I wonder if it's dangerously close to allowing the expression of certain implicit conversions (from the wrapped type to the storage type) in function argument position. That's why I think there's a lot of value in having some sort of signifier at the call site that something weird is going on.
Right, the $
syntax can really only have one meaning in this position, and it's certainly not obvious that my proposed meaning is the 'correct' one. I'm also not 100% sold in general on overloading $identifier
to mean "insert some sort of property-wrapper magic here," but it does seem better than any alternative syntaxes I've seen suggested or come up with myself... It's certainly a benefit that many more novice users who have never defined a property wrapper themselves likely already think of
$
as being some sort of magical property wrapper operator (and indeed, I've seen it described as such even in official documentation!).