Bug? no suitable method found for ArrayToList(char[])

mindful

Active Member
Licensed User
B4X:
    Dim x As List
    x.Initialize2(Array As Char("a", "b", "c"))

will give the following compiler error:
B4X:
 error: no suitable method found for ArrayToList(char[])
_x.Initialize2(anywheresoftware.b4a.keywords.Common.ArrayToList(new char[]{BA.ObjectToChar("a"),BA.ObjectToChar("b"),BA.ObjectToChar("c")}));
                                                   ^
    method Common.ArrayToList(Object[]) is not applicable
      (argument mismatch; char[] cannot be converted to Object[])
    method Common.ArrayToList(int[]) is not applicable
      (argument mismatch; char[] cannot be converted to int[])
    method Common.ArrayToList(long[]) is not applicable
      (argument mismatch; char[] cannot be converted to long[])
    method Common.ArrayToList(float[]) is not applicable
      (argument mismatch; char[] cannot be converted to float[])
    method Common.ArrayToList(double[]) is not applicable
      (argument mismatch; char[] cannot be converted to double[])
    method Common.ArrayToList(boolean[]) is not applicable
      (argument mismatch; char[] cannot be converted to boolean[])
    method Common.ArrayToList(short[]) is not applicable
      (argument mismatch; char[] cannot be converted to short[])
    method Common.ArrayToList(byte[]) is not applicable
      (argument mismatch; char[] cannot be converted to byte[])

so it seems that there are helper methods for all the other primitives but not for char.
 

mindful

Active Member
Licensed User
I know that I can do it that way. I was working on a serializer for php and I came across this. Just wanted to point it out, as I said the char array is the only array of primitives that can't be used to initialize a list.

It is not a bug.
It's more like a wish ;)
 
Top