- SDK 8.1.0
1) the following code works fine:
var x = Rez.Strings[:AppName]; // if AppName doesn't exist as a resource ID, this code will return null instead of crashing
2) the following code crashes:
var x = Position[:CONFIGURATION_SAT_IQ]; // Error: "Exception: UnexpectedTypeException: Expected Object/Array/Dictionary/ByteArray, given Primitive Module"
I'm curious why 1) works and 2) does not. Does this mean that Rez.Strings (and all the other Rez.* modules) are actually a different kind of module than Position?
It may be by design (or due to certain limitations), but it's kind of confusing to me as a dev.
2) prevents devs from writing certain kinds of generic code, although I realize that such code might be a bit *too* generic (as it would bypass the type checker)
e.g.
function haveConfigSupport(s as Symbol) as Boolean { return Position has s && Position.hasConfigurationSupport(Position[:s]); }