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
  • > It looks to me like maybe Monkey Types weren't implemented properly before and now they are?

    If you're implying that the problems in the OP are related to Monkey Types, I don't think so. Monkey Types provides compile-time type checking, and these errors are all run-time type errors.

    I will say that Monkey Types has a lot of room for improvement imo.

Comment
  • > It looks to me like maybe Monkey Types weren't implemented properly before and now they are?

    If you're implying that the problems in the OP are related to Monkey Types, I don't think so. Monkey Types provides compile-time type checking, and these errors are all run-time type errors.

    I will say that Monkey Types has a lot of room for improvement imo.

Children
No Data