Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Unified Diff: pkg/front_end/lib/src/fasta/source/stack_listener.dart

Issue 2675603002: Reduce strong mode errors and warnings (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/source/stack_listener.dart
diff --git a/pkg/front_end/lib/src/fasta/source/stack_listener.dart b/pkg/front_end/lib/src/fasta/source/stack_listener.dart
index 1438a2e19e66e2ec12d5ecef0647ab9c2aac4ab6..cba4a3eab3716f75be43c0731c6d244f222a69f5 100644
--- a/pkg/front_end/lib/src/fasta/source/stack_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/stack_listener.dart
@@ -55,7 +55,7 @@ abstract class StackListener extends Listener {
// TODO(ahe): This doesn't belong here. Only implemented by body_builder.dart
// and ast_builder.dart.
- void finishFunction(formals, AsyncMarker asyncModifier, body) {
+ void finishFunction(covariant formals, AsyncMarker asyncModifier, covariant body) {
return internalError("Unsupported operation");
}
@@ -72,23 +72,23 @@ abstract class StackListener extends Listener {
stack.addLast(node);
}
- Object peek() {
+ T peek<T>() {
ahe 2017/02/02 07:28:30 This is precisely the kind of changes that I'm ver
Object node = stack.last;
return node is NullValue ? null : node;
}
- Object pop() {
+ T pop<T>() {
Object node = stack.removeLast();
return node is NullValue ? null : node;
}
- Object popIfNotNull(Object value) {
+ T popIfNotNull<T>(Object value) {
return value == null ? null : pop();
}
- List popList(int n) {
+ List<T> popList<T>(int n) {
Siggi Cherem (dart-lang) 2017/02/02 04:26:58 these type-args get rid of many warnings where the
if (n == 0) return null;
- List list = new List.filled(n, null, growable: true);
+ List<T> list = new List<T>.filled(n, null, growable: true);
for (int i = n - 1; i >= 0; i--) {
list[i] = pop();
}

Powered by Google App Engine
This is Rietveld 408576698