Skip to content

Commit 6467500

Browse files
aaronlademann-wfkevmoo
authored andcommitted
Make _IdentityConverter compatible with Dart SDK 1.x (flutter#18)
Fixes DDC compilation regression introduced by flutter#17
1 parent 0310659 commit 6467500

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.1.1
2+
3+
* Fixed a DDC compilation regression for consumers using the Dart 1.x SDK that was introduced in `2.1.0`.
4+
15
## 2.1.0
26

37
* Added an `IdentityCodec<T>` which implements `Codec<T,T>` for use as default

lib/src/identity_codec.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'dart:convert';
22

33
class _IdentityConverter<T> extends Converter<T, T> {
4-
const _IdentityConverter();
4+
_IdentityConverter();
55
T convert(T input) => input;
66
}
77

@@ -17,8 +17,8 @@ class _IdentityConverter<T> extends Converter<T, T> {
1717
class IdentityCodec<T> extends Codec<T, T> {
1818
const IdentityCodec();
1919

20-
Converter<T, T> get decoder => _IdentityConverter<T>();
21-
Converter<T, T> get encoder => _IdentityConverter<T>();
20+
Converter<T, T> get decoder => new _IdentityConverter<T>();
21+
Converter<T, T> get encoder => new _IdentityConverter<T>();
2222

2323
/// Fuse with an other codec.
2424
///

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: convert
2-
version: 2.1.0
2+
version: 2.1.1
33
description: Utilities for converting between data representations.
44
author: Dart Team <[email protected]>
55
homepage: https://github.com/dart-lang/convert

0 commit comments

Comments
 (0)