How should I do “type safe” programming in Oxygene in the following (uncompilable) example:
type Degrees = Single; Rads = Single; method Rotate (anAngle: Degrees); method Rotate (anAngle: Rads);
The Degrees and Rads are only type aliases and are implicitly convertible amongst each other and the base type. The only way I am able to declare these functions in type-safe manner (or at all) is to have Degrees and Rads as classes, but thats an overkill in this case.
I would like NOT to be able to supply wrong type to the method and have no warning - it should not compile.
Did I miss a language feature here, or how do you guys do this?