Make _IdentityConverter compatible with Dart SDK 1.x (#18)
Fixes DDC compilation regression introduced by #17
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f300a0c..d3b3410 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 2.1.1
+
+ * Fixed a DDC compilation regression for consumers using the Dart 1.x SDK that was introduced in `2.1.0`.
+
## 2.1.0
* Added an `IdentityCodec<T>` which implements `Codec<T,T>` for use as default
diff --git a/lib/src/identity_codec.dart b/lib/src/identity_codec.dart
index 1936481..3a2d028 100644
--- a/lib/src/identity_codec.dart
+++ b/lib/src/identity_codec.dart
@@ -1,7 +1,7 @@
import 'dart:convert';
class _IdentityConverter<T> extends Converter<T, T> {
- const _IdentityConverter();
+ _IdentityConverter();
T convert(T input) => input;
}
@@ -17,8 +17,8 @@
class IdentityCodec<T> extends Codec<T, T> {
const IdentityCodec();
- Converter<T, T> get decoder => _IdentityConverter<T>();
- Converter<T, T> get encoder => _IdentityConverter<T>();
+ Converter<T, T> get decoder => new _IdentityConverter<T>();
+ Converter<T, T> get encoder => new _IdentityConverter<T>();
/// Fuse with an other codec.
///
diff --git a/pubspec.yaml b/pubspec.yaml
index f3a4d67..e788c48 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: convert
-version: 2.1.0
+version: 2.1.1
description: Utilities for converting between data representations.
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/convert