Chromium Code Reviews| 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(); |
| } |