Index: pkg/analyzer/lib/src/fasta/resolution_applier.dart |
diff --git a/pkg/analyzer/lib/src/fasta/resolution_applier.dart b/pkg/analyzer/lib/src/fasta/resolution_applier.dart |
index dedddee32efc59e6dd5b08541c65a022e9eed761..a2fe075233fbb7790bd44e6c988e9f57db1aa4ee 100644 |
--- a/pkg/analyzer/lib/src/fasta/resolution_applier.dart |
+++ b/pkg/analyzer/lib/src/fasta/resolution_applier.dart |
@@ -37,7 +37,27 @@ class ResolutionApplier extends GeneralizingAstVisitor { |
node.staticType = _getTypeFor(node); |
} |
- DartType _getTypeFor(Expression node) { |
+ @override |
+ void visitVariableDeclarationList(VariableDeclarationList node) { |
+ if (node.variables.length != 1) { |
+ // TODO(paulberry): handle this case |
+ throw new UnimplementedError('Multiple variables in one declaration'); |
+ } |
+ if (node.metadata.isNotEmpty) { |
+ // TODO(paulberry): handle this case |
+ throw new UnimplementedError('Metadata on a variable declaration list'); |
+ } |
+ node.variables.accept(this); |
+ if (node.type != null) { |
+ _applyTypeAnnotation(node.variables[0].name.staticType, node.type); |
+ } |
+ } |
+ |
+ void _applyTypeAnnotation(DartType type, TypeAnnotation typeAnnotation) { |
scheglov
2017/07/13 21:15:17
I think it will do the opposite - apply "type" _to
Paul Berry
2017/07/13 21:17:05
Done.
|
+ // TODO(paulberry): implement this. |
+ } |
+ |
+ DartType _getTypeFor(AstNode node) { |
return _types[_typeIndex++]; |
} |
} |
@@ -63,7 +83,7 @@ class ValidatingResolutionApplier extends ResolutionApplier { |
} |
@override |
- DartType _getTypeFor(Expression node) { |
+ DartType _getTypeFor(AstNode node) { |
if (_debug) print('Getting type for $node'); |
if (node.offset != _typeOffsets[_typeIndex]) { |
throw new StateError( |