Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit 4403aaa

Browse files
authored
Accept an Iterable in literalList (#162)
Since the LiteralListExpression is in the public API we shouldn't change it's field type, so immediately call .toList()
1 parent dd2180c commit 4403aaa

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
* Imports are prefixed with `_i1` rather than `_1` which satisfies the lint
44
`lowercase_with_underscores`.
5+
* `literalList` accepts an `Iterable` argument.
56

67
## 2.1.0
78

lib/src/specs/expression/literal.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ Expression literalString(String value, {bool raw: false}) {
6060
}
6161

6262
/// Creates a literal list expression from [values].
63-
LiteralListExpression literalList(List<Object> values, [Reference type]) {
64-
return new LiteralListExpression._(false, values, type);
63+
LiteralListExpression literalList(Iterable<Object> values, [Reference type]) {
64+
return new LiteralListExpression._(false, values.toList(), type);
6565
}
6666

6767
/// Creates a literal `const` list expression from [values].

0 commit comments

Comments
 (0)