In Dart, what is the difference between initializing a List<int>
with new operator and initializing it with literal?
case 1:
List<int> args = new List<int>(2);
args[0] = 1;
args[1] = 2;
case 2:
List<int> args = <int>[1, 2];
when I post the args to a native service port, the service port will receive different messages. The List instance initialized with new operator was serialized to Dart_CObject::kIntArray, but the instance initialized with literal was serialized to a Dart_CObject object with type 12.