diff --git a/lib/src/dbus_dart_type.dart b/lib/src/dbus_dart_type.dart index c9129dc..6395235 100644 --- a/lib/src/dbus_dart_type.dart +++ b/lib/src/dbus_dart_type.dart @@ -327,29 +327,29 @@ class DBusArrayType extends DBusDartType { String dbusToNative(String name) { switch (childSignature.value) { case 'y': - return '$name.mapByte().toList()'; + return '($name as DBusArray).mapByte().toList()'; case 'n': - return '$name.mapInt16().toList()'; + return '($name as DBusArray).mapInt16().toList()'; case 'q': - return '$name.mapUint16().toList()'; + return '($name as DBusArray).mapUint16().toList()'; case 'i': - return '$name.mapInt32().toList()'; + return '($name as DBusArray).mapInt32().toList()'; case 'u': - return '$name.mapUint32().toList()'; + return '($name as DBusArray).mapUint32().toList()'; case 'x': - return '$name.mapInt64().toList()'; + return '($name as DBusArray).mapInt64().toList()'; case 't': - return '$name.mapUint64().toList()'; + return '($name as DBusArray).mapUint64().toList()'; case 'd': - return '$name.mapDouble().toList()'; + return '($name as DBusArray).mapDouble().toList()'; case 's': - return '$name.mapString().toList()'; + return '($name as DBusArray).mapString().toList()'; case 'o': - return '$name.objectPath().toList()'; + return '($name as DBusArray).objectPath().toList()'; case 'g': - return '$name.signature().toList()'; + return '($name as DBusArray).signature().toList()'; case 'v': - return '$name.mapVariant().toList()'; + return '($name as DBusArray).mapVariant().toList()'; default: var childType = getDartType(childSignature); var convertedValue = childType.dbusToNative('child'); diff --git a/test/generated-code/method-multiple-inputs.server.out b/test/generated-code/method-multiple-inputs.server.out index 0a0a5ba..8e3a08a 100644 --- a/test/generated-code/method-multiple-inputs.server.out +++ b/test/generated-code/method-multiple-inputs.server.out @@ -21,7 +21,7 @@ class ComExampleTest extends DBusObject { if (methodCall.signature != DBusSignature('ybnqiuxtdsogv(si)ayabanaqaiauaxatadasaoagava(si)aasa{sv}a{us}a{sa{sv}}')) { return DBusMethodErrorResponse.invalidArgs(); } - return doHello((methodCall.values[0] as DBusByte).value, (methodCall.values[1] as DBusBoolean).value, (methodCall.values[2] as DBusInt16).value, (methodCall.values[3] as DBusUint16).value, (methodCall.values[4] as DBusInt32).value, (methodCall.values[5] as DBusUint32).value, (methodCall.values[6] as DBusInt64).value, (methodCall.values[7] as DBusUint64).value, (methodCall.values[8] as DBusDouble).value, (methodCall.values[9] as DBusString).value, (methodCall.values[10] as DBusObjectPath).value, methodCall.values[11] as DBusSignature, (methodCall.values[12] as DBusVariant).value, methodCall.values[13] as DBusStruct, methodCall.values[14].mapByte().toList(), (methodCall.values[15] as DBusArray).children.map((child) => (child as DBusBoolean).value).toList(), methodCall.values[16].mapInt16().toList(), methodCall.values[17].mapUint16().toList(), methodCall.values[18].mapInt32().toList(), methodCall.values[19].mapUint32().toList(), methodCall.values[20].mapInt64().toList(), methodCall.values[21].mapUint64().toList(), methodCall.values[22].mapDouble().toList(), methodCall.values[23].mapString().toList(), methodCall.values[24].objectPath().toList(), methodCall.values[25].signature().toList(), methodCall.values[26].mapVariant().toList(), (methodCall.values[27] as DBusArray).children.map((child) => child as DBusStruct).toList(), (methodCall.values[28] as DBusArray).children.map((child) => child.mapString().toList()).toList(), (methodCall.values[29] as DBusDict).mapStringVariant(), (methodCall.values[30] as DBusDict).children.map((key, value) => MapEntry((key as DBusUint32).value, (value as DBusString).value)), (methodCall.values[31] as DBusDict).children.map((key, value) => MapEntry((key as DBusString).value, (value as DBusDict).mapStringVariant()))); + return doHello((methodCall.values[0] as DBusByte).value, (methodCall.values[1] as DBusBoolean).value, (methodCall.values[2] as DBusInt16).value, (methodCall.values[3] as DBusUint16).value, (methodCall.values[4] as DBusInt32).value, (methodCall.values[5] as DBusUint32).value, (methodCall.values[6] as DBusInt64).value, (methodCall.values[7] as DBusUint64).value, (methodCall.values[8] as DBusDouble).value, (methodCall.values[9] as DBusString).value, (methodCall.values[10] as DBusObjectPath).value, methodCall.values[11] as DBusSignature, (methodCall.values[12] as DBusVariant).value, methodCall.values[13] as DBusStruct, (methodCall.values[14] as DBusArray).mapByte().toList(), (methodCall.values[15] as DBusArray).children.map((child) => (child as DBusBoolean).value).toList(), (methodCall.values[16] as DBusArray).mapInt16().toList(), (methodCall.values[17] as DBusArray).mapUint16().toList(), (methodCall.values[18] as DBusArray).mapInt32().toList(), (methodCall.values[19] as DBusArray).mapUint32().toList(), (methodCall.values[20] as DBusArray).mapInt64().toList(), (methodCall.values[21] as DBusArray).mapUint64().toList(), (methodCall.values[22] as DBusArray).mapDouble().toList(), (methodCall.values[23] as DBusArray).mapString().toList(), (methodCall.values[24] as DBusArray).objectPath().toList(), (methodCall.values[25] as DBusArray).signature().toList(), (methodCall.values[26] as DBusArray).mapVariant().toList(), (methodCall.values[27] as DBusArray).children.map((child) => child as DBusStruct).toList(), (methodCall.values[28] as DBusArray).children.map((child) => (child as DBusArray).mapString().toList()).toList(), (methodCall.values[29] as DBusDict).mapStringVariant(), (methodCall.values[30] as DBusDict).children.map((key, value) => MapEntry((key as DBusUint32).value, (value as DBusString).value)), (methodCall.values[31] as DBusDict).children.map((key, value) => MapEntry((key as DBusString).value, (value as DBusDict).mapStringVariant()))); } else { return DBusMethodErrorResponse.unknownMethod(); } diff --git a/test/generated-code/properties.client.out b/test/generated-code/properties.client.out index 583947b..e1b36ef 100644 --- a/test/generated-code/properties.client.out +++ b/test/generated-code/properties.client.out @@ -160,7 +160,7 @@ class ComExampleTest extends DBusRemoteObject { /// Gets com.example.Test.ArrayProperty Future> getArrayProperty() async { var value = await getProperty('com.example.Test', 'ArrayProperty', signature: DBusSignature('ay')); - return value.mapByte().toList(); + return (value as DBusArray).mapByte().toList(); } /// Sets com.example.Test.ArrayProperty diff --git a/test/generated-code/properties.server.out b/test/generated-code/properties.server.out index a916d08..15c7b6b 100644 --- a/test/generated-code/properties.server.out +++ b/test/generated-code/properties.server.out @@ -298,7 +298,7 @@ class ComExampleTest extends DBusObject { if (value.signature != DBusSignature('ay')) { return DBusMethodErrorResponse.invalidArgs(); } - return setArrayProperty(value.mapByte().toList()); + return setArrayProperty((value as DBusArray).mapByte().toList()); } else if (name == 'DictProperty') { if (value.signature != DBusSignature('a{sv}')) { return DBusMethodErrorResponse.invalidArgs(); diff --git a/test/generated-code/signal-multiple-args.client.out b/test/generated-code/signal-multiple-args.client.out index ef04344..70a9414 100644 --- a/test/generated-code/signal-multiple-args.client.out +++ b/test/generated-code/signal-multiple-args.client.out @@ -16,21 +16,21 @@ class ComExampleTestEvent extends DBusSignal { DBusSignature get signature_value => values[11] as DBusSignature; DBusValue get variant_value => (values[12] as DBusVariant).value; DBusStruct get struct_value => values[13] as DBusStruct; - List get array_value_y => values[14].mapByte().toList(); + List get array_value_y => (values[14] as DBusArray).mapByte().toList(); List get array_value_b => (values[15] as DBusArray).children.map((child) => (child as DBusBoolean).value).toList(); - List get array_value_n => values[16].mapInt16().toList(); - List get array_value_q => values[17].mapUint16().toList(); - List get array_value_u => values[18].mapInt32().toList(); - List get array_value_n_ => values[19].mapUint32().toList(); - List get array_value_x => values[20].mapInt64().toList(); - List get array_value_t => values[21].mapUint64().toList(); - List get array_value_d => values[22].mapDouble().toList(); - List get array_value_s => values[23].mapString().toList(); - List get array_value_o => values[24].objectPath().toList(); - List get array_value_g => values[25].signature().toList(); - List get array_value_v => values[26].mapVariant().toList(); + List get array_value_n => (values[16] as DBusArray).mapInt16().toList(); + List get array_value_q => (values[17] as DBusArray).mapUint16().toList(); + List get array_value_u => (values[18] as DBusArray).mapInt32().toList(); + List get array_value_n_ => (values[19] as DBusArray).mapUint32().toList(); + List get array_value_x => (values[20] as DBusArray).mapInt64().toList(); + List get array_value_t => (values[21] as DBusArray).mapUint64().toList(); + List get array_value_d => (values[22] as DBusArray).mapDouble().toList(); + List get array_value_s => (values[23] as DBusArray).mapString().toList(); + List get array_value_o => (values[24] as DBusArray).objectPath().toList(); + List get array_value_g => (values[25] as DBusArray).signature().toList(); + List get array_value_v => (values[26] as DBusArray).mapVariant().toList(); List get array_value_struct => (values[27] as DBusArray).children.map((child) => child as DBusStruct).toList(); - List> get array_value_array => (values[28] as DBusArray).children.map((child) => child.mapString().toList()).toList(); + List> get array_value_array => (values[28] as DBusArray).children.map((child) => (child as DBusArray).mapString().toList()).toList(); Map get dict_value_sv => (values[29] as DBusDict).mapStringVariant(); Map get dict_value_us => (values[30] as DBusDict).children.map((key, value) => MapEntry((key as DBusUint32).value, (value as DBusString).value)); Map> get dict_value_dict => (values[31] as DBusDict).children.map((key, value) => MapEntry((key as DBusString).value, (value as DBusDict).mapStringVariant()));