Acknowledged

Regression - arrays are totally broken (SDK 4.1.2)

var arr = ["A", "B"];
arr.toString();

Gives

Error: Unhandled Exception
Exception: UnexpectedTypeException: Expected Number/Float/Long/Double/Char, given Number/Array

var arr = ["A", "B"];
for (var i = 0; i < arr.size(); i++) {
    arr[i];
}

Gives

Error: Unhandled Exception
Exception: UnexpectedTypeException: Expected Number/Float/Boolean/Long/Double, given Object

var arr = new Lang.Array();
arr.add("A");

Gives

Error: Unhandled Exception
Exception: UnexpectedTypeException: Expected Array, given String

SDK version 4.1.2.

Parents
  • So I tried the following code...

            var a = ["a", "b"];
            System.println("a.toString() = " + a.toString());
    ...with the following SDKs:
    - 4.0.10: works
    - 4.1.1: crashes
    - 4.1.2: crashes
    - 4.1.5: crashes
    - 4.1.6: works
    - 4.1.7: works
    The simulated device was Fenix 6 Pro.
    I also tried fr235, which actually worked for all of above SDKs.
    Pretty weird stuff since Array.toString() has been around since 1.0.0.
    I have a feeling Garmin won't do anything about this since it's already been fixed in newer SDKs. (I doubt they'll release a 4.1.5.1, for example.)
Comment
  • So I tried the following code...

            var a = ["a", "b"];
            System.println("a.toString() = " + a.toString());
    ...with the following SDKs:
    - 4.0.10: works
    - 4.1.1: crashes
    - 4.1.2: crashes
    - 4.1.5: crashes
    - 4.1.6: works
    - 4.1.7: works
    The simulated device was Fenix 6 Pro.
    I also tried fr235, which actually worked for all of above SDKs.
    Pretty weird stuff since Array.toString() has been around since 1.0.0.
    I have a feeling Garmin won't do anything about this since it's already been fixed in newer SDKs. (I doubt they'll release a 4.1.5.1, for example.)
Children
No Data