Acknowledged
CIQQA-4100

Array.removeAll() does not accept null despite documentation

According to the documentation, Array.removeAll() should accept null as a parameter, although its exact behavior in that case is not specified. One might expect it to remove all entries.

However, the compiler does not accept null as a valid argument. I will attach a screenshot in a follow-up post to illustrate the issue.

  • Reading between the lines here, it seems that you have called x.removeAll(null), where x is of type Array<$.EvccWidgetBaseSiteView>.

    As per the dev docs, while Monkey C does not support generics per se, the built in containers Array and Dictionary are typed based on their contents (as we have all seen in other cases).

    So it seems that in the case of Array.removeAll(), the first argument is actually the same type as the array element type, as opposed to Object or Null. It seems that the type checker is actually being smart here.

    According to the documentation, Array.removeAll() should accept null as a parameter, although its exact behavior in that case is not specified. One might expect it to remove all entries.

    I would expect it to remove all instances of null, personally.

  • The screenshot below shows both the documented function signature and, at the same time, the compiler error that is raised despite this documentation.