diff --git a/angel_serialize_generator/CHANGELOG.md b/angel_serialize_generator/CHANGELOG.md index d66ac7da..011405e6 100644 --- a/angel_serialize_generator/CHANGELOG.md +++ b/angel_serialize_generator/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.4.1+1 +* Change `as Iterable` to `.cast`. + # 2.4.1 * Support `serializesTo`. * Don't emit `@required` if there is a default value. diff --git a/angel_serialize_generator/lib/serialize.dart b/angel_serialize_generator/lib/serialize.dart index cb56fb3b..40baa45b 100644 --- a/angel_serialize_generator/lib/serialize.dart +++ b/angel_serialize_generator/lib/serialize.dart @@ -239,7 +239,8 @@ class SerializerGenerator extends GeneratorForAnnotation { var rc = new ReCase(type.typeArguments[0].name); deserializedRepresentation = "map['$alias'] is Iterable" " ? new List.unmodifiable(((map['$alias'] as Iterable)" - ".where((x) => x is Map) as Iterable)" + ".where((x) => x is Map))" + ".cast()" ".map(${rc.pascalCase}Serializer.fromMap))" " : $defaultValue"; } else if (isMapToModelType(type)) { diff --git a/angel_serialize_generator/pubspec.yaml b/angel_serialize_generator/pubspec.yaml index f725cd45..1775fd74 100644 --- a/angel_serialize_generator/pubspec.yaml +++ b/angel_serialize_generator/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_serialize_generator -version: 2.4.1 +version: 2.4.1+1 description: Model serialization generators, designed for use with Angel. Combine with angel_serialize for flexible modeling. author: Tobe O homepage: https://github.com/angel-dart/serialize