@maurelian suggested a feature for Solidity that has a very good implementation cost / usefulness ratio in my opinion. It would be great to get some feedback on it from Solidity users:
(issue description copied here for convenience)
It should be possible to define a user-defined type that is identical to a provided value type (including operators, members, etc.), but cannot be implicitly converted to any other type, and can only be explicitly converted to and from the underlying value type.
This has the effect that arithmetic operations are impossible to perform across these types.
Example (syntax under discussion):
typedef DistanceInMeters uint; typedef DistanceInInch uint; typedef Price fixed128x10; DistanceInMeters distanceToDestination; Price buyerPrice; Price sellerPrice;
In the above, you can do
buyerPrice - sellerPrice, but you cannot do
buyerPrice * distanceToDestination.