I need to assign a NSNumber value to a `@Binding var value: T`

, is this the right way?

```
extension NSNumber {
/// Convert this `NSNumber` to a concrete type, used like this:
/// ```
/// @Binding var field: T // T is known here
/// field = anNSNumber.convert() // so type can be inferred
/// ```
/// - Parameter type: the type to convert to, should automatically inferred from assignment on the left side
/// - Returns: the value of this `NSNumber` in specific type T
// 🤔 is there anyway here to constraint `T` to only what `NSNumber` can handle?
// I guess if this is possible, we wouldn't need this giant switch/case?
func convert<T>(_ type: T.Type = T.self) -> T {
switch type {
case is Bool.Type:
return boolValue as! T
case is CChar.Type:
return int8Value as! T
case is Decimal.Type:
return decimalValue as! T
case is Double.Type:
return doubleValue as! T
case is Float.Type:
return floatValue as! T
case is Int32.Type:
return int32Value as! T
case is Int.Type:
return intValue as! T
case is Int64.Type:
return int64Value as! T
case is Int16.Type:
return int16Value as! T
case is UInt8.Type:
return uint8Value as! T
case is UInt.Type:
return uintValue as! T
case is UInt32.Type:
return uint32Value as! T
case is UInt64.Type:
return uint64Value as! T
case is UInt16.Type:
return uint16Value as! T
default:
fatalError("Unknown type (\(type)), NSNumber is unable to convert to this type (:.")
}
}
}
```