Skip to content

Commit 8c29e83

Browse files
author
Kilian Schulte
committed
[bump] version 2.1.1
1 parent 715be78 commit 8c29e83

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
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 bug with generic type ids containing `dynamic`.
4+
15
# 2.1.0
26

37
- Ignore whitespaces in type ids.

lib/src/resolved_type.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class ResolvedType {
7070

7171
String get id {
7272
var nullSuffix = isNullable ? '?' : '';
73-
if (args.isNotEmpty && args.any((t) => t.reversed != dynamic)) {
73+
if (args.isNotEmpty) {
7474
return '${base.baseId}<${args.map((r) => r.id).join(',')}>$nullSuffix';
7575
} else {
7676
return '$baseId$nullSuffix';

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: type_plus
22
description: Give your types superpowers and spice up your generics. Make types great again.
3-
version: 2.1.0
3+
version: 2.1.1
44
repository: https://github.com/schultek/type_plus
55
issue_tracker: https://github.com/schultek/type_plus/issues
66
funding:

test/type_plus_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ void main() {
6060

6161
test('type composition works', () {
6262
expect(TypePlus.fromId('Future<int>'), equals(typeOf<Future<int>>()));
63+
expect(TypePlus.fromId('Future<dynamic>'), equals(typeOf<Future<dynamic>>()));
64+
expect(TypePlus.fromId('Future<dynamic>').id, equals('Future<dynamic>'));
6365

6466
expect((int).provideTo(<T>() => T.id), equals('int'));
6567
expect(typeOf<Iterable<num>>().provideTo(<T>() => T.args.first), equals(num));

0 commit comments

Comments
 (0)