Skip to content

Commit

Permalink
Make _IdentityConverter compatible with Dart SDK 1.x (flutter#18)
Browse files Browse the repository at this point in the history
Fixes DDC compilation regression introduced by flutter#17
  • Loading branch information
aaronlademann-wf authored and kevmoo committed Dec 19, 2018
1 parent 0310659 commit 6467500
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/src/identity_codec.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:convert';

class _IdentityConverter<T> extends Converter<T, T> {
const _IdentityConverter();
_IdentityConverter();
T convert(T input) => input;
}

Expand All @@ -17,8 +17,8 @@ class _IdentityConverter<T> extends Converter<T, T> {
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.
///
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 6467500

Please sign in to comment.