Fix all strong mode warnings.
R=rnystrom@google.com
Review URL: https://codereview.chromium.org//1845043002 .
diff --git a/.analysis_options b/.analysis_options
new file mode 100644
index 0000000..a10d4c5
--- /dev/null
+++ b/.analysis_options
@@ -0,0 +1,2 @@
+analyzer:
+ strong-mode: true
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0d8803f..0c64b66 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.0.1
+
+* Fix all strong mode warnings.
+
## 1.0.0
* Initial release.
diff --git a/lib/src/evaluator.dart b/lib/src/evaluator.dart
index 9102add..6401a37 100644
--- a/lib/src/evaluator.dart
+++ b/lib/src/evaluator.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'package:collection/collection.dart';
+
import 'ast.dart';
import 'visitor.dart';
@@ -15,8 +17,8 @@
Evaluator(semantics)
: _semantics = semantics is Iterable
- ? semantics.toSet().contains
- : semantics;
+ ? DelegatingIterable.typed(semantics.toSet()).contains
+ : semantics as _Semantics;
bool visitVariable(VariableNode node) => _semantics(node.name);
diff --git a/lib/src/parser.dart b/lib/src/parser.dart
index f9ab470..49c1e72 100644
--- a/lib/src/parser.dart
+++ b/lib/src/parser.dart
@@ -96,7 +96,7 @@
return child;
case TokenType.identifier:
- return new VariableNode(token.name, token.span);
+ return new VariableNode((token as IdentifierToken).name, token.span);
default:
throw new SourceSpanFormatException("Expected expression.", token.span);
diff --git a/pubspec.yaml b/pubspec.yaml
index 9c0090b..f3960d3 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: boolean_selector
-version: 1.0.0
+version: 1.0.1
description: A flexible syntax for boolean expressions.
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/boolean_selector
@@ -8,6 +8,7 @@
sdk: '>=1.8.0 <2.0.0'
dependencies:
+ collection: '^1.5.0'
source_span: '^1.0.0'
string_scanner: '^0.1.1'