Hi.
I was enjoying using property wrappers for its great customization abilities. But I recently encountered a case where it would be great for this feature to act specifically based on a context in which it is being used. Look at example:
@Smarttype var number = 1
func requiresPointer(_ pointer: UnsafePointer<Int>)
func requiresInt(_ int: Int)
requiresPointer(number) //Would be great to have this, imo
requiresInt(number) //Works like a miracle
//I belive it can be something like this under the hood
@propertyWrapper
struct Smarttype {
var wrappedValue: UnsafePointer<Int> { ... }
var wrappedValue: Int { ... }
}
What do you think about this? @John_McCall