Hi,
I've modified my code to avoid this, but I don't see why the syntax should be able to cause a crash. Can somebody, possibly Travis.ConnectIQ explain?
var raw, symbol, obj;
System.println("");
System.println("START TEST STRINGS");
raw = Rez.Strings.AppName;
obj = Rez.Strings;
symbol = :AppName;
if(obj has symbol) {
System.println("has symbol "+symbol);
System.println("get "+Rez.Strings[symbol]+" should equal "+raw);
}
System.println("");
System.println("START TEST SENSOR");
raw = Toybox.Sensor.SENSOR_HEARTRATE;
obj = Toybox.Sensor;
symbol = :SENSOR_HEARTRATE;
if(obj has symbol) {
System.println("has symbol "+symbol);
System.println("get "+Toybox.Sensor[symbol]+" should equal "+raw);
}
Gets:
START TEST STRINGS has symbol symbol (24) get 1550 should equal 1550 START TEST SENSOR has symbol symbol (8388954) Error: Unhandled Exception Exception: UnexpectedTypeException: Expected Object/Array/Dictionary/ByteArray, given Primitive Module Stack:
I had thought both of them should work.
Thanks,
G