| Index: pkg/analyzer/lib/src/summary/summarize_ast.dart
|
| diff --git a/pkg/analyzer/lib/src/summary/summarize_ast.dart b/pkg/analyzer/lib/src/summary/summarize_ast.dart
|
| index 715267bde9d6f8e81af3d2ab7f2b08175efb27c4..c544336a8ee028e26eaa4eb1f65fe2984104a5a9 100644
|
| --- a/pkg/analyzer/lib/src/summary/summarize_ast.dart
|
| +++ b/pkg/analyzer/lib/src/summary/summarize_ast.dart
|
| @@ -89,15 +89,16 @@ class _ConstExprSerializer extends AbstractConstExprSerializer {
|
| }
|
|
|
| @override
|
| - EntityRefBuilder serializePropertyAccess(PropertyAccess access) {
|
| - Expression target = access.target;
|
| - if (target is Identifier) {
|
| - EntityRefBuilder targetRef = serializeIdentifier(target);
|
| - return new EntityRefBuilder(reference: visitor.serializeReference(
|
| - targetRef.reference, access.propertyName.name));
|
| + EntityRefBuilder serializeIdentifierSequence(Expression expr) {
|
| + if (expr is Identifier) {
|
| + return serializeIdentifier(expr);
|
| + }
|
| + if (expr is PropertyAccess) {
|
| + int targetId = serializeIdentifierSequence(expr.target).reference;
|
| + int nameId = visitor.serializeReference(targetId, expr.propertyName.name);
|
| + return new EntityRefBuilder(reference: nameId);
|
| } else {
|
| - // TODO(scheglov) should we handle other targets in malformed constants?
|
| - throw new StateError('Unexpected target type: ${target.runtimeType}');
|
| + throw new StateError('Unexpected node type: ${expr.runtimeType}');
|
| }
|
| }
|
|
|
| @@ -824,7 +825,8 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
|
| b.annotations = serializeAnnotations(annotations);
|
| b.codeRange = serializeCodeRange(variables.parent);
|
| if (variable.isConst ||
|
| - variable.isFinal && isField && !isDeclaredStatic) {
|
| + variable.isFinal && isField && !isDeclaredStatic ||
|
| + variables.type == null) {
|
| Expression initializer = variable.initializer;
|
| if (initializer != null) {
|
| b.constExpr = serializeConstExpr(initializer);
|
|
|